Generated by Cython 0.20 on Sun Jan 26 10:26:09 2014
Raw output: msgpack.cpp
1: # coding: utf-8
/* "pandas/msgpack.pyx":1 * # coding: utf-8 # <<<<<<<<<<<<<< * #cython: embedsignature=True * #cython: profile=False */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2: #cython: embedsignature=True
3: #cython: profile=False
4:
5: from cpython cimport *
6: cdef extern from "Python.h":
7: ctypedef char* const_char_ptr "const char*"
8: ctypedef char* const_void_ptr "const void*"
9: ctypedef struct PyObject
10: cdef int PyObject_AsReadBuffer(object o, const_void_ptr* buff, Py_ssize_t* buf_len) except -1
11:
12: from libc.stdlib cimport *
13: from libc.string cimport *
14: from libc.limits cimport *
15:
16: import cython
17: import numpy as np
/* "pandas/msgpack.pyx":17 * * import cython * import numpy as np # <<<<<<<<<<<<<< * from numpy cimport * * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18: from numpy cimport *
19:
20: class UnpackException(IOError):
/* "pandas/msgpack.pyx":20 * from numpy cimport * * * class UnpackException(IOError): # <<<<<<<<<<<<<< * pass * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_builtin_IOError); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_IOError); __Pyx_GIVEREF(__pyx_builtin_IOError); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_UnpackException, __pyx_n_s_UnpackException, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_UnpackException, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnpackException, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21: pass
22:
23:
24: class BufferFull(UnpackException):
/* "pandas/msgpack.pyx":24 * * * class BufferFull(UnpackException): # <<<<<<<<<<<<<< * pass * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_BufferFull, __pyx_n_s_BufferFull, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BufferFull, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BufferFull, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25: pass
26:
27:
28: class OutOfData(UnpackException):
/* "pandas/msgpack.pyx":28 * * * class OutOfData(UnpackException): # <<<<<<<<<<<<<< * pass * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_OutOfData, __pyx_n_s_OutOfData, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_OutOfData, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_OutOfData, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29: pass
30:
31:
32: class UnpackValueError(UnpackException, ValueError):
/* "pandas/msgpack.pyx":32 * * * class UnpackValueError(UnpackException, ValueError): # <<<<<<<<<<<<<< * pass * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(__pyx_builtin_ValueError); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_ValueError); __Pyx_GIVEREF(__pyx_builtin_ValueError); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_UnpackValueError, __pyx_n_s_UnpackValueError, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_UnpackValueError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnpackValueError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33: pass
34:
35:
36: class ExtraData(ValueError):
/* "pandas/msgpack.pyx":36 * * * class ExtraData(ValueError): # <<<<<<<<<<<<<< * def __init__(self, unpacked, extra): * self.unpacked = unpacked */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_builtin_ValueError); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_ValueError); __Pyx_GIVEREF(__pyx_builtin_ValueError); __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ExtraData, __pyx_n_s_ExtraData, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "pandas/msgpack.pyx":36 * * * class ExtraData(ValueError): # <<<<<<<<<<<<<< * def __init__(self, unpacked, extra): * self.unpacked = unpacked */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ExtraData, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExtraData, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37: def __init__(self, unpacked, extra):
/* "pandas/msgpack.pyx":37
*
* class ExtraData(ValueError):
* def __init__(self, unpacked, extra): # <<<<<<<<<<<<<<
* self.unpacked = unpacked
* self.extra = extra
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_7msgpack_9ExtraData___init__[] = "ExtraData.__init__(self, unpacked, extra)";
static PyMethodDef __pyx_mdef_6pandas_7msgpack_9ExtraData_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_6pandas_7msgpack_9ExtraData_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_9ExtraData___init__)};
static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_unpacked = 0;
PyObject *__pyx_v_extra = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unpacked,&__pyx_n_s_extra,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);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unpacked)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extra)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __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_unpacked = values[1];
__pyx_v_extra = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.ExtraData.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_9ExtraData___init__(__pyx_self, __pyx_v_self, __pyx_v_unpacked, __pyx_v_extra);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unpacked, PyObject *__pyx_v_extra) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
/* "pandas/msgpack.pyx":37
*
* class ExtraData(ValueError):
* def __init__(self, unpacked, extra): # <<<<<<<<<<<<<<
* self.unpacked = unpacked
* self.extra = extra
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("pandas.msgpack.ExtraData.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "pandas/msgpack.pyx":37
*
* class ExtraData(ValueError):
* def __init__(self, unpacked, extra): # <<<<<<<<<<<<<<
* self.unpacked = unpacked
* self.extra = extra
*/
__pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_unpacked, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__29);
__Pyx_GIVEREF(__pyx_tuple__29);
/* "pandas/msgpack.pyx":37
*
* class ExtraData(ValueError):
* def __init__(self, unpacked, extra): # <<<<<<<<<<<<<<
* self.unpacked = unpacked
* self.extra = extra
*/
__pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_9ExtraData_1__init__, 0, __pyx_n_s_ExtraData___init, NULL, __pyx_n_s_pandas_msgpack, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mnt_home_jreback_pandas_pandas, __pyx_n_s_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38: self.unpacked = unpacked
/* "pandas/msgpack.pyx":38 * class ExtraData(ValueError): * def __init__(self, unpacked, extra): * self.unpacked = unpacked # <<<<<<<<<<<<<< * self.extra = extra * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_unpacked, __pyx_v_unpacked) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39: self.extra = extra
/* "pandas/msgpack.pyx":39 * def __init__(self, unpacked, extra): * self.unpacked = unpacked * self.extra = extra # <<<<<<<<<<<<<< * * def __str__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_extra, __pyx_v_extra) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40:
41: def __str__(self):
/* "pandas/msgpack.pyx":41
* self.extra = extra
*
* def __str__(self): # <<<<<<<<<<<<<<
* return "unpack(b) recieved extra data."
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6pandas_7msgpack_9ExtraData_2__str__[] = "ExtraData.__str__(self)";
static PyMethodDef __pyx_mdef_6pandas_7msgpack_9ExtraData_3__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_6pandas_7msgpack_9ExtraData_3__str__, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_9ExtraData_2__str__)};
static PyObject *__pyx_pw_6pandas_7msgpack_9ExtraData_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
__pyx_r = __pyx_pf_6pandas_7msgpack_9ExtraData_2__str__(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_9ExtraData_2__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__str__", 0);
/* "pandas/msgpack.pyx":41
* self.extra = extra
*
* def __str__(self): # <<<<<<<<<<<<<<
* return "unpack(b) recieved extra data."
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "pandas/msgpack.pyx":41
* self.extra = extra
*
* def __str__(self): # <<<<<<<<<<<<<<
* return "unpack(b) recieved extra data."
*
*/
__pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__31);
__Pyx_GIVEREF(__pyx_tuple__31);
/* "pandas/msgpack.pyx":41
* self.extra = extra
*
* def __str__(self): # <<<<<<<<<<<<<<
* return "unpack(b) recieved extra data."
*
*/
__pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_9ExtraData_3__str__, 0, __pyx_n_s_ExtraData___str, NULL, __pyx_n_s_pandas_msgpack, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mnt_home_jreback_pandas_pandas, __pyx_n_s_str, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42: return "unpack(b) recieved extra data."
/* "pandas/msgpack.pyx":42 * * def __str__(self): * return "unpack(b) recieved extra data." # <<<<<<<<<<<<<< * * class PackException(IOError): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s_unpack_b_recieved_extra_data); __pyx_r = __pyx_kp_s_unpack_b_recieved_extra_data; goto __pyx_L0;
43:
44: class PackException(IOError):
/* "pandas/msgpack.pyx":44 * return "unpack(b) recieved extra data." * * class PackException(IOError): # <<<<<<<<<<<<<< * pass * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_builtin_IOError); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_IOError); __Pyx_GIVEREF(__pyx_builtin_IOError); __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PackException, __pyx_n_s_PackException, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PackException, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PackException, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
45: pass
46:
47: class PackValueError(PackException, ValueError):
/* "pandas/msgpack.pyx":47 * pass * * class PackValueError(PackException, ValueError): # <<<<<<<<<<<<<< * pass * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_INCREF(__pyx_builtin_ValueError); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_ValueError); __Pyx_GIVEREF(__pyx_builtin_ValueError); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_PackValueError, __pyx_n_s_PackValueError, (PyObject *) NULL, __pyx_n_s_pandas_msgpack, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PackValueError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PackValueError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48: pass
49:
50: cdef extern from "msgpack/unpack.h":
51: ctypedef struct msgpack_user:
52: bint use_list
53: PyObject* object_hook
54: bint has_pairs_hook # call object_hook with k-v pairs
55: PyObject* list_hook
56: char *encoding
57: char *unicode_errors
58:
59: ctypedef struct template_context:
60: msgpack_user user
61: PyObject* obj
62: size_t count
63: unsigned int ct
64: PyObject* key
65:
66: ctypedef int (*execute_fn)(template_context* ctx, const_char_ptr data,
67: size_t len, size_t* off) except? -1
68: execute_fn template_construct
69: execute_fn template_skip
70: execute_fn read_array_header
71: execute_fn read_map_header
72: void template_init(template_context* ctx)
73: object template_data(template_context* ctx)
74:
75: cdef extern from "msgpack/pack.h":
76: struct msgpack_packer:
77: char* buf
78: size_t length
79: size_t buf_size
80:
81: int msgpack_pack_int(msgpack_packer* pk, int d)
82: int msgpack_pack_nil(msgpack_packer* pk)
83: int msgpack_pack_true(msgpack_packer* pk)
84: int msgpack_pack_false(msgpack_packer* pk)
85: int msgpack_pack_long(msgpack_packer* pk, long d)
86: int msgpack_pack_long_long(msgpack_packer* pk, long long d)
87: int msgpack_pack_unsigned_long_long(msgpack_packer* pk, unsigned long long d)
88: int msgpack_pack_float(msgpack_packer* pk, float d)
89: int msgpack_pack_double(msgpack_packer* pk, double d)
90: int msgpack_pack_array(msgpack_packer* pk, size_t l)
91: int msgpack_pack_map(msgpack_packer* pk, size_t l)
92: int msgpack_pack_raw(msgpack_packer* pk, size_t l)
93: int msgpack_pack_raw_body(msgpack_packer* pk, char* body, size_t l)
94:
95: cdef int DEFAULT_RECURSE_LIMIT=511
/* "pandas/msgpack.pyx":95 * int msgpack_pack_raw_body(msgpack_packer* pk, char* body, size_t l) * * cdef int DEFAULT_RECURSE_LIMIT=511 # <<<<<<<<<<<<<< * * */ __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT = 511;
96:
97:
98:
99: cdef class Packer(object):
/* "pandas/msgpack.pyx":99
*
*
* cdef class Packer(object): # <<<<<<<<<<<<<<
* """MessagePack Packer
*
*/
struct __pyx_obj_6pandas_7msgpack_Packer {
PyObject_HEAD
struct __pyx_vtabstruct_6pandas_7msgpack_Packer *__pyx_vtab;
struct msgpack_packer pk;
PyObject *_default;
PyObject *_bencoding;
PyObject *_berrors;
char *encoding;
char *unicode_errors;
PyBoolObject *use_float;
int autoreset;
};
/* "pandas/msgpack.pyx":99
*
*
* cdef class Packer(object): # <<<<<<<<<<<<<<
* """MessagePack Packer
*
*/
struct __pyx_vtabstruct_6pandas_7msgpack_Packer {
int (*_pack)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack *__pyx_optional_args);
PyObject *(*pack)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, int __pyx_skip_dispatch);
PyObject *(*pack_pair)(struct __pyx_obj_6pandas_7msgpack_Packer *, PyObject *, PyObject *, int);
};
static struct __pyx_vtabstruct_6pandas_7msgpack_Packer *__pyx_vtabptr_6pandas_7msgpack_Packer;
100: """MessagePack Packer
101:
102: usage:
103:
104: packer = Packer()
105: astream.write(packer.pack(a))
106: astream.write(packer.pack(b))
107:
108: Packer's constructor has some keyword arguments:
109:
110: * *defaut* - Convert user type to builtin type that Packer supports.
111: See also simplejson's document.
112: * *encoding* - Convert unicode to bytes with this encoding. (default: 'utf-8')
113: * *unicode_errors* - Error handler for encoding unicode. (default: 'strict')
114: * *use_single_float* - Use single precision float type for float. (default: False)
115: * *autoreset* - Reset buffer after each pack and return it's content as `bytes`. (default: True).
116: If set this to false, use `bytes()` to get content and `.reset()` to clear buffer.
117: """
118: cdef msgpack_packer pk
119: cdef object _default
120: cdef object _bencoding
121: cdef object _berrors
122: cdef char *encoding
123: cdef char *unicode_errors
124: cdef bool use_float
125: cdef bint autoreset
126:
127: def __cinit__(self):
/* "pandas/msgpack.pyx":127
* cdef bint autoreset
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* cdef int buf_size = 1024*1024
* self.pk.buf = <char*> malloc(buf_size);
*/
/* Python wrapper */
static int __pyx_pw_6pandas_7msgpack_6Packer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_7msgpack_6Packer_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_6pandas_7msgpack_6Packer___cinit__(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_6pandas_7msgpack_6Packer___cinit__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) {
int __pyx_v_buf_size;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "pandas/msgpack.pyx":127
* cdef bint autoreset
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* cdef int buf_size = 1024*1024
* self.pk.buf = <char*> malloc(buf_size);
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pandas.msgpack.Packer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
128: cdef int buf_size = 1024*1024
/* "pandas/msgpack.pyx":128 * * def __cinit__(self): * cdef int buf_size = 1024*1024 # <<<<<<<<<<<<<< * self.pk.buf = <char*> malloc(buf_size); * if self.pk.buf == NULL: */ __pyx_v_buf_size = 1048576;
129: self.pk.buf = <char*> malloc(buf_size);
/* "pandas/msgpack.pyx":129
* def __cinit__(self):
* cdef int buf_size = 1024*1024
* self.pk.buf = <char*> malloc(buf_size); # <<<<<<<<<<<<<<
* if self.pk.buf == NULL:
* raise MemoryError("Unable to allocate internal buffer.")
*/
__pyx_v_self->pk.buf = ((char *)malloc(__pyx_v_buf_size));
130: if self.pk.buf == NULL:
/* "pandas/msgpack.pyx":130
* cdef int buf_size = 1024*1024
* self.pk.buf = <char*> malloc(buf_size);
* if self.pk.buf == NULL: # <<<<<<<<<<<<<<
* raise MemoryError("Unable to allocate internal buffer.")
* self.pk.buf_size = buf_size
*/
__pyx_t_1 = ((__pyx_v_self->pk.buf == NULL) != 0);
if (__pyx_t_1) {
131: raise MemoryError("Unable to allocate internal buffer.")
/* "pandas/msgpack.pyx":131
* self.pk.buf = <char*> malloc(buf_size);
* if self.pk.buf == NULL:
* raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<<
* self.pk.buf_size = buf_size
* self.pk.length = 0
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":131
* self.pk.buf = <char*> malloc(buf_size);
* if self.pk.buf == NULL:
* raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<<
* self.pk.buf_size = buf_size
* self.pk.length = 0
*/
__pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Unable_to_allocate_internal_buff); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
132: self.pk.buf_size = buf_size
/* "pandas/msgpack.pyx":132
* if self.pk.buf == NULL:
* raise MemoryError("Unable to allocate internal buffer.")
* self.pk.buf_size = buf_size # <<<<<<<<<<<<<<
* self.pk.length = 0
*
*/
__pyx_v_self->pk.buf_size = __pyx_v_buf_size;
133: self.pk.length = 0
/* "pandas/msgpack.pyx":133
* raise MemoryError("Unable to allocate internal buffer.")
* self.pk.buf_size = buf_size
* self.pk.length = 0 # <<<<<<<<<<<<<<
*
* def __init__(self, default=None, encoding='utf-8', unicode_errors='strict',
*/
__pyx_v_self->pk.length = 0;
134:
135: def __init__(self, default=None, encoding='utf-8', unicode_errors='strict',
/* "pandas/msgpack.pyx":135
* self.pk.length = 0
*
* def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', # <<<<<<<<<<<<<<
* use_single_float=False, bint autoreset=1):
* self.use_float = use_single_float
*/
/* Python wrapper */
static int __pyx_pw_6pandas_7msgpack_6Packer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_7msgpack_6Packer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_default = 0;
PyObject *__pyx_v_encoding = 0;
PyObject *__pyx_v_unicode_errors = 0;
PyObject *__pyx_v_use_single_float = 0;
int __pyx_v_autoreset;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_default,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_use_single_float,&__pyx_n_s_autoreset,0};
PyObject* values[5] = {0,0,0,0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)__pyx_kp_s_utf_8);
values[2] = ((PyObject *)__pyx_n_s_strict);
/* "pandas/msgpack.pyx":135
* self.pk.length = 0
*
* def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', # <<<<<<<<<<<<<<
* use_single_float=False, bint autoreset=1):
* self.use_float = use_single_float
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_6pandas_7msgpack_6Packer_2__init__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float, int __pyx_v_autoreset) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
/* "pandas/msgpack.pyx":135
* self.pk.length = 0
*
* def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', # <<<<<<<<<<<<<<
* use_single_float=False, bint autoreset=1):
* self.use_float = use_single_float
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pandas.msgpack.Packer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
136: use_single_float=False, bint autoreset=1):
/* "pandas/msgpack.pyx":136
*
* def __init__(self, default=None, encoding='utf-8', unicode_errors='strict',
* use_single_float=False, bint autoreset=1): # <<<<<<<<<<<<<<
* self.use_float = use_single_float
* self.autoreset = autoreset
*/
values[3] = ((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 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
if (value) { values[0] = value; kw_args--; }
}
case 1:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
if (value) { values[1] = value; kw_args--; }
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_single_float);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_autoreset);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_default = values[0];
__pyx_v_encoding = values[1];
__pyx_v_unicode_errors = values[2];
__pyx_v_use_single_float = values[3];
if (values[4]) {
__pyx_v_autoreset = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_autoreset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_autoreset = ((int)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.Packer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_2__init__(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), __pyx_v_default, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_use_single_float, __pyx_v_autoreset);
137: self.use_float = use_single_float
/* "pandas/msgpack.pyx":137 * def __init__(self, default=None, encoding='utf-8', unicode_errors='strict', * use_single_float=False, bint autoreset=1): * self.use_float = use_single_float # <<<<<<<<<<<<<< * self.autoreset = autoreset * if default is not None: */ if (!(likely(((__pyx_v_use_single_float) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_use_single_float, __pyx_ptype_7cpython_4bool_bool))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_v_use_single_float; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->use_float); __Pyx_DECREF(((PyObject *)__pyx_v_self->use_float)); __pyx_v_self->use_float = ((PyBoolObject *)__pyx_t_1); __pyx_t_1 = 0;
138: self.autoreset = autoreset
/* "pandas/msgpack.pyx":138
* use_single_float=False, bint autoreset=1):
* self.use_float = use_single_float
* self.autoreset = autoreset # <<<<<<<<<<<<<<
* if default is not None:
* if not PyCallable_Check(default):
*/
__pyx_v_self->autoreset = __pyx_v_autoreset;
139: if default is not None:
/* "pandas/msgpack.pyx":139
* self.use_float = use_single_float
* self.autoreset = autoreset
* if default is not None: # <<<<<<<<<<<<<<
* if not PyCallable_Check(default):
* raise TypeError("default must be a callable.")
*/
__pyx_t_2 = (__pyx_v_default != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
140: if not PyCallable_Check(default):
/* "pandas/msgpack.pyx":140
* self.autoreset = autoreset
* if default is not None:
* if not PyCallable_Check(default): # <<<<<<<<<<<<<<
* raise TypeError("default must be a callable.")
* self._default = default
*/
__pyx_t_3 = ((!(PyCallable_Check(__pyx_v_default) != 0)) != 0);
if (__pyx_t_3) {
141: raise TypeError("default must be a callable.")
/* "pandas/msgpack.pyx":141
* if default is not None:
* if not PyCallable_Check(default):
* raise TypeError("default must be a callable.") # <<<<<<<<<<<<<<
* self._default = default
* if encoding is None:
*/
__pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
goto __pyx_L3;
}
__pyx_L3:;
/* "pandas/msgpack.pyx":141
* if default is not None:
* if not PyCallable_Check(default):
* raise TypeError("default must be a callable.") # <<<<<<<<<<<<<<
* self._default = default
* if encoding is None:
*/
__pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_default_must_be_a_callable); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
142: self._default = default
/* "pandas/msgpack.pyx":142 * if not PyCallable_Check(default): * raise TypeError("default must be a callable.") * self._default = default # <<<<<<<<<<<<<< * if encoding is None: * self.encoding = NULL */ __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); __Pyx_GOTREF(__pyx_v_self->_default); __Pyx_DECREF(__pyx_v_self->_default); __pyx_v_self->_default = __pyx_v_default;
143: if encoding is None:
/* "pandas/msgpack.pyx":143
* raise TypeError("default must be a callable.")
* self._default = default
* if encoding is None: # <<<<<<<<<<<<<<
* self.encoding = NULL
* self.unicode_errors = NULL
*/
__pyx_t_3 = (__pyx_v_encoding == Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
144: self.encoding = NULL
/* "pandas/msgpack.pyx":144
* self._default = default
* if encoding is None:
* self.encoding = NULL # <<<<<<<<<<<<<<
* self.unicode_errors = NULL
* else:
*/
__pyx_v_self->encoding = NULL;
145: self.unicode_errors = NULL
/* "pandas/msgpack.pyx":145
* if encoding is None:
* self.encoding = NULL
* self.unicode_errors = NULL # <<<<<<<<<<<<<<
* else:
* if isinstance(encoding, unicode):
*/
__pyx_v_self->unicode_errors = NULL;
goto __pyx_L5;
}
/*else*/ {
146: else:
147: if isinstance(encoding, unicode):
/* "pandas/msgpack.pyx":147
* self.unicode_errors = NULL
* else:
* if isinstance(encoding, unicode): # <<<<<<<<<<<<<<
* self._bencoding = encoding.encode('ascii')
* else:
*/
__pyx_t_2 = PyUnicode_Check(__pyx_v_encoding);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
148: self._bencoding = encoding.encode('ascii')
/* "pandas/msgpack.pyx":148
* else:
* if isinstance(encoding, unicode):
* self._bencoding = encoding.encode('ascii') # <<<<<<<<<<<<<<
* else:
* self._bencoding = encoding
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __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_self->_bencoding);
__Pyx_DECREF(__pyx_v_self->_bencoding);
__pyx_v_self->_bencoding = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L6;
}
/*else*/ {
/* "pandas/msgpack.pyx":148
* else:
* if isinstance(encoding, unicode):
* self._bencoding = encoding.encode('ascii') # <<<<<<<<<<<<<<
* else:
* self._bencoding = encoding
*/
__pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
149: else:
150: self._bencoding = encoding
/* "pandas/msgpack.pyx":150
* self._bencoding = encoding.encode('ascii')
* else:
* self._bencoding = encoding # <<<<<<<<<<<<<<
* self.encoding = PyBytes_AsString(self._bencoding)
* if isinstance(unicode_errors, unicode):
*/
__Pyx_INCREF(__pyx_v_encoding);
__Pyx_GIVEREF(__pyx_v_encoding);
__Pyx_GOTREF(__pyx_v_self->_bencoding);
__Pyx_DECREF(__pyx_v_self->_bencoding);
__pyx_v_self->_bencoding = __pyx_v_encoding;
}
__pyx_L6:;
151: self.encoding = PyBytes_AsString(self._bencoding)
/* "pandas/msgpack.pyx":151
* else:
* self._bencoding = encoding
* self.encoding = PyBytes_AsString(self._bencoding) # <<<<<<<<<<<<<<
* if isinstance(unicode_errors, unicode):
* self._berrors = unicode_errors.encode('ascii')
*/
__pyx_t_4 = __pyx_v_self->_bencoding;
__Pyx_INCREF(__pyx_t_4);
__pyx_t_5 = PyBytes_AsString(__pyx_t_4); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_self->encoding = __pyx_t_5;
152: if isinstance(unicode_errors, unicode):
/* "pandas/msgpack.pyx":152
* self._bencoding = encoding
* self.encoding = PyBytes_AsString(self._bencoding)
* if isinstance(unicode_errors, unicode): # <<<<<<<<<<<<<<
* self._berrors = unicode_errors.encode('ascii')
* else:
*/
__pyx_t_3 = PyUnicode_Check(__pyx_v_unicode_errors);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
153: self._berrors = unicode_errors.encode('ascii')
/* "pandas/msgpack.pyx":153
* self.encoding = PyBytes_AsString(self._bencoding)
* if isinstance(unicode_errors, unicode):
* self._berrors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<<
* else:
* self._berrors = unicode_errors
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicode_errors, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __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_self->_berrors);
__Pyx_DECREF(__pyx_v_self->_berrors);
__pyx_v_self->_berrors = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L7;
}
/*else*/ {
/* "pandas/msgpack.pyx":153
* self.encoding = PyBytes_AsString(self._bencoding)
* if isinstance(unicode_errors, unicode):
* self._berrors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<<
* else:
* self._berrors = unicode_errors
*/
__pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
154: else:
155: self._berrors = unicode_errors
/* "pandas/msgpack.pyx":155
* self._berrors = unicode_errors.encode('ascii')
* else:
* self._berrors = unicode_errors # <<<<<<<<<<<<<<
* self.unicode_errors = PyBytes_AsString(self._berrors)
*
*/
__Pyx_INCREF(__pyx_v_unicode_errors);
__Pyx_GIVEREF(__pyx_v_unicode_errors);
__Pyx_GOTREF(__pyx_v_self->_berrors);
__Pyx_DECREF(__pyx_v_self->_berrors);
__pyx_v_self->_berrors = __pyx_v_unicode_errors;
}
__pyx_L7:;
156: self.unicode_errors = PyBytes_AsString(self._berrors)
/* "pandas/msgpack.pyx":156
* else:
* self._berrors = unicode_errors
* self.unicode_errors = PyBytes_AsString(self._berrors) # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_t_1 = __pyx_v_self->_berrors;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_5 = PyBytes_AsString(__pyx_t_1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->unicode_errors = __pyx_t_5;
}
__pyx_L5:;
157:
158: def __dealloc__(self):
/* "pandas/msgpack.pyx":158 * self.unicode_errors = PyBytes_AsString(self._berrors) * * def __dealloc__(self): # <<<<<<<<<<<<<< * free(self.pk.buf); * */ /* Python wrapper */ static void __pyx_pw_6pandas_7msgpack_6Packer_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_6pandas_7msgpack_6Packer_5__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_6pandas_7msgpack_6Packer_4__dealloc__(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_6pandas_7msgpack_6Packer_4__dealloc__(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pandas/msgpack.pyx":158 * self.unicode_errors = PyBytes_AsString(self._berrors) * * def __dealloc__(self): # <<<<<<<<<<<<<< * free(self.pk.buf); * */ /* function exit code */ __Pyx_RefNannyFinishContext(); }
159: free(self.pk.buf);
/* "pandas/msgpack.pyx":159 * * def __dealloc__(self): * free(self.pk.buf); # <<<<<<<<<<<<<< * * @cython.boundscheck(False) */ free(__pyx_v_self->pk.buf);
160:
161: @cython.boundscheck(False)
162: @cython.wraparound(False)
163: cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1:
/* "pandas/msgpack.pyx":163
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<<
* cdef long long llval
* cdef unsigned long long ullval
*/
static int __pyx_f_6pandas_7msgpack_6Packer__pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_o, struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack *__pyx_optional_args) {
int __pyx_v_nest_limit = __pyx_k__5;
PY_LONG_LONG __pyx_v_llval;
unsigned PY_LONG_LONG __pyx_v_ullval;
long __pyx_v_longval;
float __pyx_v_fval;
double __pyx_v_dval;
char *__pyx_v_rawval;
int __pyx_v_ret;
PyObject *__pyx_v_d = 0;
PyObject *__pyx_v_k = NULL;
PyObject *__pyx_v_v = NULL;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_pack", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_nest_limit = __pyx_optional_args->nest_limit;
}
}
__Pyx_INCREF(__pyx_v_o);
/* "pandas/msgpack.pyx":163
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<<
* cdef long long llval
* cdef unsigned long long ullval
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_t_18);
__Pyx_XDECREF(__pyx_t_19);
__Pyx_AddTraceback("pandas.msgpack.Packer._pack", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_d);
__Pyx_XDECREF(__pyx_v_k);
__Pyx_XDECREF(__pyx_v_v);
__Pyx_XDECREF(__pyx_v_o);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "pandas/msgpack.pyx":163
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<<
* cdef long long llval
* cdef unsigned long long ullval
*/
__pyx_k__5 = __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT;
/* "pandas/msgpack.pyx":163
* @cython.boundscheck(False)
* @cython.wraparound(False)
* cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1: # <<<<<<<<<<<<<<
* cdef long long llval
* cdef unsigned long long ullval
*/
struct __pyx_opt_args_6pandas_7msgpack_6Packer__pack {
int __pyx_n;
int nest_limit;
};
164: cdef long long llval
165: cdef unsigned long long ullval
166: cdef long longval
167: cdef float fval
168: cdef double dval
169: cdef char* rawval
170: cdef int ret
171: cdef dict d
172: cdef object dtype
173:
174: cdef int n,i
175:
176: if nest_limit < 0:
/* "pandas/msgpack.pyx":176
* cdef int n,i
*
* if nest_limit < 0: # <<<<<<<<<<<<<<
* raise PackValueError("recursion limit exceeded.")
*
*/
__pyx_t_1 = ((__pyx_v_nest_limit < 0) != 0);
if (__pyx_t_1) {
177: raise PackValueError("recursion limit exceeded.")
/* "pandas/msgpack.pyx":177
*
* if nest_limit < 0:
* raise PackValueError("recursion limit exceeded.") # <<<<<<<<<<<<<<
*
* if o is None:
*/
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackValueError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":177
*
* if nest_limit < 0:
* raise PackValueError("recursion limit exceeded.") # <<<<<<<<<<<<<<
*
* if o is None:
*/
__pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_recursion_limit_exceeded); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
178:
179: if o is None:
/* "pandas/msgpack.pyx":179
* raise PackValueError("recursion limit exceeded.")
*
* if o is None: # <<<<<<<<<<<<<<
* ret = msgpack_pack_nil(&self.pk)
* elif isinstance(o, bool):
*/
__pyx_t_1 = (__pyx_v_o == Py_None);
__pyx_t_4 = (__pyx_t_1 != 0);
if (__pyx_t_4) {
180: ret = msgpack_pack_nil(&self.pk)
/* "pandas/msgpack.pyx":180
*
* if o is None:
* ret = msgpack_pack_nil(&self.pk) # <<<<<<<<<<<<<<
* elif isinstance(o, bool):
* if o:
*/
__pyx_v_ret = msgpack_pack_nil((&__pyx_v_self->pk));
goto __pyx_L4;
}
181: elif isinstance(o, bool):
/* "pandas/msgpack.pyx":181
* if o is None:
* ret = msgpack_pack_nil(&self.pk)
* elif isinstance(o, bool): # <<<<<<<<<<<<<<
* if o:
* ret = msgpack_pack_true(&self.pk)
*/
__pyx_t_4 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject*)__pyx_ptype_7cpython_4bool_bool));
__pyx_t_1 = (__pyx_t_4 != 0);
if (__pyx_t_1) {
182: if o:
/* "pandas/msgpack.pyx":182
* ret = msgpack_pack_nil(&self.pk)
* elif isinstance(o, bool):
* if o: # <<<<<<<<<<<<<<
* ret = msgpack_pack_true(&self.pk)
* else:
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_o); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
183: ret = msgpack_pack_true(&self.pk)
/* "pandas/msgpack.pyx":183
* elif isinstance(o, bool):
* if o:
* ret = msgpack_pack_true(&self.pk) # <<<<<<<<<<<<<<
* else:
* ret = msgpack_pack_false(&self.pk)
*/
__pyx_v_ret = msgpack_pack_true((&__pyx_v_self->pk));
goto __pyx_L5;
}
/*else*/ {
184: else:
185: ret = msgpack_pack_false(&self.pk)
/* "pandas/msgpack.pyx":185
* ret = msgpack_pack_true(&self.pk)
* else:
* ret = msgpack_pack_false(&self.pk) # <<<<<<<<<<<<<<
* elif PyLong_Check(o):
* if o > 0:
*/
__pyx_v_ret = msgpack_pack_false((&__pyx_v_self->pk));
}
__pyx_L5:;
goto __pyx_L4;
}
186: elif PyLong_Check(o):
/* "pandas/msgpack.pyx":186 * else: * ret = msgpack_pack_false(&self.pk) * elif PyLong_Check(o): # <<<<<<<<<<<<<< * if o > 0: * ullval = o */ __pyx_t_1 = (PyLong_Check(__pyx_v_o) != 0); if (__pyx_t_1) {
187: if o > 0:
/* "pandas/msgpack.pyx":187
* ret = msgpack_pack_false(&self.pk)
* elif PyLong_Check(o):
* if o > 0: # <<<<<<<<<<<<<<
* ullval = o
* ret = msgpack_pack_unsigned_long_long(&self.pk, ullval)
*/
__pyx_t_3 = PyObject_RichCompare(__pyx_v_o, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
188: ullval = o
/* "pandas/msgpack.pyx":188
* elif PyLong_Check(o):
* if o > 0:
* ullval = o # <<<<<<<<<<<<<<
* ret = msgpack_pack_unsigned_long_long(&self.pk, ullval)
* else:
*/
__pyx_t_5 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_o); if (unlikely((__pyx_t_5 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ullval = __pyx_t_5;
189: ret = msgpack_pack_unsigned_long_long(&self.pk, ullval)
/* "pandas/msgpack.pyx":189
* if o > 0:
* ullval = o
* ret = msgpack_pack_unsigned_long_long(&self.pk, ullval) # <<<<<<<<<<<<<<
* else:
* llval = o
*/
__pyx_v_ret = msgpack_pack_unsigned_long_long((&__pyx_v_self->pk), __pyx_v_ullval);
goto __pyx_L6;
}
/*else*/ {
190: else:
191: llval = o
/* "pandas/msgpack.pyx":191
* ret = msgpack_pack_unsigned_long_long(&self.pk, ullval)
* else:
* llval = o # <<<<<<<<<<<<<<
* ret = msgpack_pack_long_long(&self.pk, llval)
* elif PyInt_Check(o):
*/
__pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_o); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_llval = __pyx_t_6;
192: ret = msgpack_pack_long_long(&self.pk, llval)
/* "pandas/msgpack.pyx":192
* else:
* llval = o
* ret = msgpack_pack_long_long(&self.pk, llval) # <<<<<<<<<<<<<<
* elif PyInt_Check(o):
* longval = o
*/
__pyx_v_ret = msgpack_pack_long_long((&__pyx_v_self->pk), __pyx_v_llval);
}
__pyx_L6:;
goto __pyx_L4;
}
193: elif PyInt_Check(o):
/* "pandas/msgpack.pyx":193 * llval = o * ret = msgpack_pack_long_long(&self.pk, llval) * elif PyInt_Check(o): # <<<<<<<<<<<<<< * longval = o * ret = msgpack_pack_long(&self.pk, longval) */ __pyx_t_1 = (PyInt_Check(__pyx_v_o) != 0); if (__pyx_t_1) {
194: longval = o
/* "pandas/msgpack.pyx":194
* ret = msgpack_pack_long_long(&self.pk, llval)
* elif PyInt_Check(o):
* longval = o # <<<<<<<<<<<<<<
* ret = msgpack_pack_long(&self.pk, longval)
* elif PyFloat_Check(o):
*/
__pyx_t_7 = __Pyx_PyInt_As_long(__pyx_v_o); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_longval = __pyx_t_7;
195: ret = msgpack_pack_long(&self.pk, longval)
/* "pandas/msgpack.pyx":195
* elif PyInt_Check(o):
* longval = o
* ret = msgpack_pack_long(&self.pk, longval) # <<<<<<<<<<<<<<
* elif PyFloat_Check(o):
* if self.use_float:
*/
__pyx_v_ret = msgpack_pack_long((&__pyx_v_self->pk), __pyx_v_longval);
goto __pyx_L4;
}
196: elif PyFloat_Check(o):
/* "pandas/msgpack.pyx":196 * longval = o * ret = msgpack_pack_long(&self.pk, longval) * elif PyFloat_Check(o): # <<<<<<<<<<<<<< * if self.use_float: * fval = o */ __pyx_t_1 = (PyFloat_Check(__pyx_v_o) != 0); if (__pyx_t_1) {
197: if self.use_float:
/* "pandas/msgpack.pyx":197
* ret = msgpack_pack_long(&self.pk, longval)
* elif PyFloat_Check(o):
* if self.use_float: # <<<<<<<<<<<<<<
* fval = o
* ret = msgpack_pack_float(&self.pk, fval)
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->use_float)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
198: fval = o
/* "pandas/msgpack.pyx":198
* elif PyFloat_Check(o):
* if self.use_float:
* fval = o # <<<<<<<<<<<<<<
* ret = msgpack_pack_float(&self.pk, fval)
* else:
*/
__pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_o); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_fval = __pyx_t_8;
199: ret = msgpack_pack_float(&self.pk, fval)
/* "pandas/msgpack.pyx":199
* if self.use_float:
* fval = o
* ret = msgpack_pack_float(&self.pk, fval) # <<<<<<<<<<<<<<
* else:
* dval = o
*/
__pyx_v_ret = msgpack_pack_float((&__pyx_v_self->pk), __pyx_v_fval);
goto __pyx_L7;
}
/*else*/ {
200: else:
201: dval = o
/* "pandas/msgpack.pyx":201
* ret = msgpack_pack_float(&self.pk, fval)
* else:
* dval = o # <<<<<<<<<<<<<<
* ret = msgpack_pack_double(&self.pk, dval)
* elif PyBytes_Check(o):
*/
__pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_o); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_dval = __pyx_t_9;
202: ret = msgpack_pack_double(&self.pk, dval)
/* "pandas/msgpack.pyx":202
* else:
* dval = o
* ret = msgpack_pack_double(&self.pk, dval) # <<<<<<<<<<<<<<
* elif PyBytes_Check(o):
* rawval = o
*/
__pyx_v_ret = msgpack_pack_double((&__pyx_v_self->pk), __pyx_v_dval);
}
__pyx_L7:;
goto __pyx_L4;
}
203: elif PyBytes_Check(o):
/* "pandas/msgpack.pyx":203 * dval = o * ret = msgpack_pack_double(&self.pk, dval) * elif PyBytes_Check(o): # <<<<<<<<<<<<<< * rawval = o * ret = msgpack_pack_raw(&self.pk, len(o)) */ __pyx_t_1 = (PyBytes_Check(__pyx_v_o) != 0); if (__pyx_t_1) {
204: rawval = o
/* "pandas/msgpack.pyx":204
* ret = msgpack_pack_double(&self.pk, dval)
* elif PyBytes_Check(o):
* rawval = o # <<<<<<<<<<<<<<
* ret = msgpack_pack_raw(&self.pk, len(o))
* if ret == 0:
*/
__pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_o); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_rawval = __pyx_t_10;
205: ret = msgpack_pack_raw(&self.pk, len(o))
/* "pandas/msgpack.pyx":205
* elif PyBytes_Check(o):
* rawval = o
* ret = msgpack_pack_raw(&self.pk, len(o)) # <<<<<<<<<<<<<<
* if ret == 0:
* ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
*/
__pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = msgpack_pack_raw((&__pyx_v_self->pk), __pyx_t_11);
206: if ret == 0:
/* "pandas/msgpack.pyx":206
* rawval = o
* ret = msgpack_pack_raw(&self.pk, len(o))
* if ret == 0: # <<<<<<<<<<<<<<
* ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
* elif PyUnicode_Check(o):
*/
__pyx_t_1 = ((__pyx_v_ret == 0) != 0);
if (__pyx_t_1) {
207: ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
/* "pandas/msgpack.pyx":207
* ret = msgpack_pack_raw(&self.pk, len(o))
* if ret == 0:
* ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) # <<<<<<<<<<<<<<
* elif PyUnicode_Check(o):
* if not self.encoding:
*/
__pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = msgpack_pack_raw_body((&__pyx_v_self->pk), __pyx_v_rawval, __pyx_t_11);
goto __pyx_L8;
}
__pyx_L8:;
goto __pyx_L4;
}
208: elif PyUnicode_Check(o):
/* "pandas/msgpack.pyx":208 * if ret == 0: * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) * elif PyUnicode_Check(o): # <<<<<<<<<<<<<< * if not self.encoding: * raise TypeError("Can't encode unicode string: no encoding is specified") */ __pyx_t_1 = (PyUnicode_Check(__pyx_v_o) != 0); if (__pyx_t_1) {
209: if not self.encoding:
/* "pandas/msgpack.pyx":209
* ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
* elif PyUnicode_Check(o):
* if not self.encoding: # <<<<<<<<<<<<<<
* raise TypeError("Can't encode unicode string: no encoding is specified")
* o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors)
*/
__pyx_t_1 = ((!(__pyx_v_self->encoding != 0)) != 0);
if (__pyx_t_1) {
210: raise TypeError("Can't encode unicode string: no encoding is specified")
/* "pandas/msgpack.pyx":210
* elif PyUnicode_Check(o):
* if not self.encoding:
* raise TypeError("Can't encode unicode string: no encoding is specified") # <<<<<<<<<<<<<<
* o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors)
* rawval = o
*/
__pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":210
* elif PyUnicode_Check(o):
* if not self.encoding:
* raise TypeError("Can't encode unicode string: no encoding is specified") # <<<<<<<<<<<<<<
* o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors)
* rawval = o
*/
__pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_t_encode_unicode_string_no_e); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
211: o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors)
/* "pandas/msgpack.pyx":211
* if not self.encoding:
* raise TypeError("Can't encode unicode string: no encoding is specified")
* o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors) # <<<<<<<<<<<<<<
* rawval = o
* ret = msgpack_pack_raw(&self.pk, len(o))
*/
__pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_o, __pyx_v_self->encoding, __pyx_v_self->unicode_errors); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_o, __pyx_t_3);
__pyx_t_3 = 0;
212: rawval = o
/* "pandas/msgpack.pyx":212
* raise TypeError("Can't encode unicode string: no encoding is specified")
* o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors)
* rawval = o # <<<<<<<<<<<<<<
* ret = msgpack_pack_raw(&self.pk, len(o))
* if ret == 0:
*/
__pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_o); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_rawval = __pyx_t_10;
213: ret = msgpack_pack_raw(&self.pk, len(o))
/* "pandas/msgpack.pyx":213
* o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors)
* rawval = o
* ret = msgpack_pack_raw(&self.pk, len(o)) # <<<<<<<<<<<<<<
* if ret == 0:
* ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
*/
__pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = msgpack_pack_raw((&__pyx_v_self->pk), __pyx_t_11);
214: if ret == 0:
/* "pandas/msgpack.pyx":214
* rawval = o
* ret = msgpack_pack_raw(&self.pk, len(o))
* if ret == 0: # <<<<<<<<<<<<<<
* ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
* elif PyDict_CheckExact(o):
*/
__pyx_t_1 = ((__pyx_v_ret == 0) != 0);
if (__pyx_t_1) {
215: ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
/* "pandas/msgpack.pyx":215
* ret = msgpack_pack_raw(&self.pk, len(o))
* if ret == 0:
* ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) # <<<<<<<<<<<<<<
* elif PyDict_CheckExact(o):
* d = <dict>o
*/
__pyx_t_11 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = msgpack_pack_raw_body((&__pyx_v_self->pk), __pyx_v_rawval, __pyx_t_11);
goto __pyx_L10;
}
__pyx_L10:;
goto __pyx_L4;
}
216: elif PyDict_CheckExact(o):
/* "pandas/msgpack.pyx":216 * if ret == 0: * ret = msgpack_pack_raw_body(&self.pk, rawval, len(o)) * elif PyDict_CheckExact(o): # <<<<<<<<<<<<<< * d = <dict>o * ret = msgpack_pack_map(&self.pk, len(d)) */ __pyx_t_1 = (PyDict_CheckExact(__pyx_v_o) != 0); if (__pyx_t_1) {
217: d = <dict>o
/* "pandas/msgpack.pyx":217
* ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
* elif PyDict_CheckExact(o):
* d = <dict>o # <<<<<<<<<<<<<<
* ret = msgpack_pack_map(&self.pk, len(d))
* if ret == 0:
*/
__pyx_t_3 = __pyx_v_o;
__Pyx_INCREF(__pyx_t_3);
__pyx_v_d = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
218: ret = msgpack_pack_map(&self.pk, len(d))
/* "pandas/msgpack.pyx":218
* elif PyDict_CheckExact(o):
* d = <dict>o
* ret = msgpack_pack_map(&self.pk, len(d)) # <<<<<<<<<<<<<<
* if ret == 0:
* for k, v in d.iteritems():
*/
if (unlikely(__pyx_v_d == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_11 = PyDict_Size(__pyx_v_d); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_t_11);
219: if ret == 0:
/* "pandas/msgpack.pyx":219
* d = <dict>o
* ret = msgpack_pack_map(&self.pk, len(d))
* if ret == 0: # <<<<<<<<<<<<<<
* for k, v in d.iteritems():
* ret = self._pack(k, nest_limit-1)
*/
__pyx_t_1 = ((__pyx_v_ret == 0) != 0);
if (__pyx_t_1) {
220: for k, v in d.iteritems():
/* "pandas/msgpack.pyx":220
* ret = msgpack_pack_map(&self.pk, len(d))
* if ret == 0:
* for k, v in d.iteritems(): # <<<<<<<<<<<<<<
* ret = self._pack(k, nest_limit-1)
* if ret != 0: break
*/
__pyx_t_11 = 0;
if (unlikely(__pyx_v_d == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_2 = __Pyx_dict_iterator(__pyx_v_d, 1, __pyx_n_s_iteritems, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__pyx_t_3 = __pyx_t_2;
__pyx_t_2 = 0;
while (1) {
__pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_12, &__pyx_t_11, &__pyx_t_2, &__pyx_t_14, NULL, __pyx_t_13);
if (unlikely(__pyx_t_15 == 0)) break;
if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_14);
__Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
__pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14);
__pyx_t_14 = 0;
221: ret = self._pack(k, nest_limit-1)
/* "pandas/msgpack.pyx":221
* if ret == 0:
* for k, v in d.iteritems():
* ret = self._pack(k, nest_limit-1) # <<<<<<<<<<<<<<
* if ret != 0: break
* ret = self._pack(v, nest_limit-1)
*/
__pyx_t_16.__pyx_n = 1;
__pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1);
__pyx_t_15 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, &__pyx_t_16); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_15;
222: if ret != 0: break
/* "pandas/msgpack.pyx":222
* for k, v in d.iteritems():
* ret = self._pack(k, nest_limit-1)
* if ret != 0: break # <<<<<<<<<<<<<<
* ret = self._pack(v, nest_limit-1)
* if ret != 0: break
*/
__pyx_t_1 = ((__pyx_v_ret != 0) != 0);
if (__pyx_t_1) {
goto __pyx_L13_break;
}
223: ret = self._pack(v, nest_limit-1)
/* "pandas/msgpack.pyx":223
* ret = self._pack(k, nest_limit-1)
* if ret != 0: break
* ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<<
* if ret != 0: break
* elif PyDict_Check(o):
*/
__pyx_t_16.__pyx_n = 1;
__pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1);
__pyx_t_15 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_16); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_15;
224: if ret != 0: break
/* "pandas/msgpack.pyx":224
* if ret != 0: break
* ret = self._pack(v, nest_limit-1)
* if ret != 0: break # <<<<<<<<<<<<<<
* elif PyDict_Check(o):
* ret = msgpack_pack_map(&self.pk, len(o))
*/
__pyx_t_1 = ((__pyx_v_ret != 0) != 0);
if (__pyx_t_1) {
goto __pyx_L13_break;
}
}
__pyx_L13_break:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L11;
}
__pyx_L11:;
goto __pyx_L4;
}
225: elif PyDict_Check(o):
/* "pandas/msgpack.pyx":225 * ret = self._pack(v, nest_limit-1) * if ret != 0: break * elif PyDict_Check(o): # <<<<<<<<<<<<<< * ret = msgpack_pack_map(&self.pk, len(o)) * if ret == 0: */ __pyx_t_1 = (PyDict_Check(__pyx_v_o) != 0); if (__pyx_t_1) {
226: ret = msgpack_pack_map(&self.pk, len(o))
/* "pandas/msgpack.pyx":226
* if ret != 0: break
* elif PyDict_Check(o):
* ret = msgpack_pack_map(&self.pk, len(o)) # <<<<<<<<<<<<<<
* if ret == 0:
* for k, v in o.items():
*/
__pyx_t_12 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_t_12);
227: if ret == 0:
/* "pandas/msgpack.pyx":227
* elif PyDict_Check(o):
* ret = msgpack_pack_map(&self.pk, len(o))
* if ret == 0: # <<<<<<<<<<<<<<
* for k, v in o.items():
* ret = self._pack(k, nest_limit-1)
*/
__pyx_t_1 = ((__pyx_v_ret == 0) != 0);
if (__pyx_t_1) {
228: for k, v in o.items():
/* "pandas/msgpack.pyx":228
* ret = msgpack_pack_map(&self.pk, len(o))
* if ret == 0:
* for k, v in o.items(): # <<<<<<<<<<<<<<
* ret = self._pack(k, nest_limit-1)
* if ret != 0: break
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_14 = PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (PyList_CheckExact(__pyx_t_14) || PyTuple_CheckExact(__pyx_t_14)) {
__pyx_t_3 = __pyx_t_14; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_14 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_14 = __pyx_t_17(__pyx_t_3);
if (unlikely(!__pyx_t_14)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_14);
}
if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) {
PyObject* sequence = __pyx_t_14;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_18 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_18);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
#endif
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_19 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_2)) goto __pyx_L19_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L19_unpacking_failed;
__Pyx_GOTREF(__pyx_t_18);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = NULL;
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
goto __pyx_L20_unpacking_done;
__pyx_L19_unpacking_failed:;
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L20_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
__pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_18);
__pyx_t_18 = 0;
229: ret = self._pack(k, nest_limit-1)
/* "pandas/msgpack.pyx":229
* if ret == 0:
* for k, v in o.items():
* ret = self._pack(k, nest_limit-1) # <<<<<<<<<<<<<<
* if ret != 0: break
* ret = self._pack(v, nest_limit-1)
*/
__pyx_t_16.__pyx_n = 1;
__pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1);
__pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_13;
230: if ret != 0: break
/* "pandas/msgpack.pyx":230
* for k, v in o.items():
* ret = self._pack(k, nest_limit-1)
* if ret != 0: break # <<<<<<<<<<<<<<
* ret = self._pack(v, nest_limit-1)
* if ret != 0: break
*/
__pyx_t_1 = ((__pyx_v_ret != 0) != 0);
if (__pyx_t_1) {
goto __pyx_L18_break;
}
231: ret = self._pack(v, nest_limit-1)
/* "pandas/msgpack.pyx":231
* ret = self._pack(k, nest_limit-1)
* if ret != 0: break
* ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<<
* if ret != 0: break
* elif PyTuple_Check(o) or PyList_Check(o):
*/
__pyx_t_16.__pyx_n = 1;
__pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1);
__pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_13;
232: if ret != 0: break
/* "pandas/msgpack.pyx":232
* if ret != 0: break
* ret = self._pack(v, nest_limit-1)
* if ret != 0: break # <<<<<<<<<<<<<<
* elif PyTuple_Check(o) or PyList_Check(o):
* ret = msgpack_pack_array(&self.pk, len(o))
*/
__pyx_t_1 = ((__pyx_v_ret != 0) != 0);
if (__pyx_t_1) {
goto __pyx_L18_break;
}
}
__pyx_L18_break:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L16;
}
__pyx_L16:;
goto __pyx_L4;
}
233: elif PyTuple_Check(o) or PyList_Check(o):
/* "pandas/msgpack.pyx":233 * ret = self._pack(v, nest_limit-1) * if ret != 0: break * elif PyTuple_Check(o) or PyList_Check(o): # <<<<<<<<<<<<<< * ret = msgpack_pack_array(&self.pk, len(o)) * if ret == 0: */ __pyx_t_1 = (PyTuple_Check(__pyx_v_o) != 0); if (!__pyx_t_1) { __pyx_t_4 = (PyList_Check(__pyx_v_o) != 0); __pyx_t_21 = __pyx_t_4; } else { __pyx_t_21 = __pyx_t_1; } if (__pyx_t_21) {
234: ret = msgpack_pack_array(&self.pk, len(o))
/* "pandas/msgpack.pyx":234
* if ret != 0: break
* elif PyTuple_Check(o) or PyList_Check(o):
* ret = msgpack_pack_array(&self.pk, len(o)) # <<<<<<<<<<<<<<
* if ret == 0:
* for v in o:
*/
__pyx_t_12 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = msgpack_pack_array((&__pyx_v_self->pk), __pyx_t_12);
235: if ret == 0:
/* "pandas/msgpack.pyx":235
* elif PyTuple_Check(o) or PyList_Check(o):
* ret = msgpack_pack_array(&self.pk, len(o))
* if ret == 0: # <<<<<<<<<<<<<<
* for v in o:
* ret = self._pack(v, nest_limit-1)
*/
__pyx_t_21 = ((__pyx_v_ret == 0) != 0);
if (__pyx_t_21) {
236: for v in o:
/* "pandas/msgpack.pyx":236
* ret = msgpack_pack_array(&self.pk, len(o))
* if ret == 0:
* for v in o: # <<<<<<<<<<<<<<
* ret = self._pack(v, nest_limit-1)
* if ret != 0: break
*/
if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) {
__pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0;
__pyx_t_17 = NULL;
} else {
__pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
for (;;) {
if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_14 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_14); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_14 = __pyx_t_17(__pyx_t_3);
if (unlikely(!__pyx_t_14)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_14);
}
__Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_14);
__pyx_t_14 = 0;
237: ret = self._pack(v, nest_limit-1)
/* "pandas/msgpack.pyx":237
* if ret == 0:
* for v in o:
* ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<<
* if ret != 0: break
*
*/
__pyx_t_16.__pyx_n = 1;
__pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1);
__pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_13;
238: if ret != 0: break
/* "pandas/msgpack.pyx":238
* for v in o:
* ret = self._pack(v, nest_limit-1)
* if ret != 0: break # <<<<<<<<<<<<<<
*
* elif self._default:
*/
__pyx_t_21 = ((__pyx_v_ret != 0) != 0);
if (__pyx_t_21) {
goto __pyx_L25_break;
}
}
__pyx_L25_break:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L23;
}
__pyx_L23:;
goto __pyx_L4;
}
239:
240: elif self._default:
/* "pandas/msgpack.pyx":240 * if ret != 0: break * * elif self._default: # <<<<<<<<<<<<<< * o = self._default(o) * ret = self._pack(o, nest_limit-1) */ __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_v_self->_default); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_21) {
241: o = self._default(o)
/* "pandas/msgpack.pyx":241
*
* elif self._default:
* o = self._default(o) # <<<<<<<<<<<<<<
* ret = self._pack(o, nest_limit-1)
* else:
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_o);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_v_o);
__pyx_t_14 = PyObject_Call(__pyx_v_self->_default, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_o, __pyx_t_14);
__pyx_t_14 = 0;
242: ret = self._pack(o, nest_limit-1)
/* "pandas/msgpack.pyx":242
* elif self._default:
* o = self._default(o)
* ret = self._pack(o, nest_limit-1) # <<<<<<<<<<<<<<
* else:
* raise TypeError("can't serialize %r" % (o,))
*/
__pyx_t_16.__pyx_n = 1;
__pyx_t_16.nest_limit = (__pyx_v_nest_limit - 1);
__pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_o, &__pyx_t_16); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_13;
goto __pyx_L4;
}
/*else*/ {
243: else:
244: raise TypeError("can't serialize %r" % (o,))
/* "pandas/msgpack.pyx":244
* ret = self._pack(o, nest_limit-1)
* else:
* raise TypeError("can't serialize %r" % (o,)) # <<<<<<<<<<<<<<
* return ret
*
*/
__pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(__pyx_v_o);
PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_v_o);
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_can_t_serialize_r, __pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L4:;
245: return ret
/* "pandas/msgpack.pyx":245
* else:
* raise TypeError("can't serialize %r" % (o,))
* return ret # <<<<<<<<<<<<<<
*
* cpdef pack(self, object obj):
*/
__pyx_r = __pyx_v_ret;
goto __pyx_L0;
246:
247: cpdef pack(self, object obj):
/* "pandas/msgpack.pyx":247
* return ret
*
* cpdef pack(self, object obj): # <<<<<<<<<<<<<<
* cdef int ret
* ret = self._pack(obj, DEFAULT_RECURSE_LIMIT)
*/
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_7pack(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_f_6pandas_7msgpack_6Packer_pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
int __pyx_v_ret;
PyObject *__pyx_v_buf = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack", 0);
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pandas_7msgpack_6Packer_7pack)) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_obj);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_v_obj);
__pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __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;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
/* "pandas/msgpack.pyx":247
* return ret
*
* cpdef pack(self, object obj): # <<<<<<<<<<<<<<
* cdef int ret
* ret = self._pack(obj, DEFAULT_RECURSE_LIMIT)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("pandas.msgpack.Packer.pack", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_buf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_7pack(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_6pandas_7msgpack_6Packer_6pack[] = "Packer.pack(self, obj)";
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_7pack(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack (wrapper)", 0);
__pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_6pack(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((PyObject *)__pyx_v_obj));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_6pack(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_obj) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->pack(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pandas.msgpack.Packer.pack", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
248: cdef int ret
249: ret = self._pack(obj, DEFAULT_RECURSE_LIMIT)
/* "pandas/msgpack.pyx":249
* cpdef pack(self, object obj):
* cdef int ret
* ret = self._pack(obj, DEFAULT_RECURSE_LIMIT) # <<<<<<<<<<<<<<
* if ret == -1:
* raise MemoryError
*/
__pyx_t_5.__pyx_n = 1;
__pyx_t_5.nest_limit = __pyx_v_6pandas_7msgpack_DEFAULT_RECURSE_LIMIT;
__pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_obj, &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_4;
250: if ret == -1:
/* "pandas/msgpack.pyx":250
* cdef int ret
* ret = self._pack(obj, DEFAULT_RECURSE_LIMIT)
* if ret == -1: # <<<<<<<<<<<<<<
* raise MemoryError
* elif ret: # should not happen.
*/
__pyx_t_6 = ((__pyx_v_ret == -1) != 0);
if (__pyx_t_6) {
251: raise MemoryError
/* "pandas/msgpack.pyx":251
* ret = self._pack(obj, DEFAULT_RECURSE_LIMIT)
* if ret == -1:
* raise MemoryError # <<<<<<<<<<<<<<
* elif ret: # should not happen.
* raise TypeError
*/
PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
252: elif ret: # should not happen.
/* "pandas/msgpack.pyx":252
* if ret == -1:
* raise MemoryError
* elif ret: # should not happen. # <<<<<<<<<<<<<<
* raise TypeError
* if self.autoreset:
*/
__pyx_t_6 = (__pyx_v_ret != 0);
if (__pyx_t_6) {
253: raise TypeError
/* "pandas/msgpack.pyx":253
* raise MemoryError
* elif ret: # should not happen.
* raise TypeError # <<<<<<<<<<<<<<
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
*/
__Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
254: if self.autoreset:
/* "pandas/msgpack.pyx":254
* elif ret: # should not happen.
* raise TypeError
* if self.autoreset: # <<<<<<<<<<<<<<
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0
*/
__pyx_t_6 = (__pyx_v_self->autoreset != 0);
if (__pyx_t_6) {
255: buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
/* "pandas/msgpack.pyx":255
* raise TypeError
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<<
* self.pk.length = 0
* return buf
*/
__pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_buf = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
256: self.pk.length = 0
/* "pandas/msgpack.pyx":256
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0 # <<<<<<<<<<<<<<
* return buf
*
*/
__pyx_v_self->pk.length = 0;
257: return buf
/* "pandas/msgpack.pyx":257
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0
* return buf # <<<<<<<<<<<<<<
*
* def pack_array_header(self, size_t size):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_buf);
__pyx_r = __pyx_v_buf;
goto __pyx_L0;
}
258:
259: def pack_array_header(self, size_t size):
/* "pandas/msgpack.pyx":259
* return buf
*
* def pack_array_header(self, size_t size): # <<<<<<<<<<<<<<
* cdef int ret = msgpack_pack_array(&self.pk, size)
* if ret == -1:
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_9pack_array_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size); /*proto*/
static char __pyx_doc_6pandas_7msgpack_6Packer_8pack_array_header[] = "Packer.pack_array_header(self, size_t size)";
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_9pack_array_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size) {
size_t __pyx_v_size;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack_array_header (wrapper)", 0);
assert(__pyx_arg_size); {
__pyx_v_size = __Pyx_PyInt_As_size_t(__pyx_arg_size); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.Packer.pack_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_8pack_array_header(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((size_t)__pyx_v_size));
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_8pack_array_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size) {
int __pyx_v_ret;
PyObject *__pyx_v_buf = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack_array_header", 0);
/* "pandas/msgpack.pyx":259
* return buf
*
* def pack_array_header(self, size_t size): # <<<<<<<<<<<<<<
* cdef int ret = msgpack_pack_array(&self.pk, size)
* if ret == -1:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pandas.msgpack.Packer.pack_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_buf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
260: cdef int ret = msgpack_pack_array(&self.pk, size)
/* "pandas/msgpack.pyx":260 * * def pack_array_header(self, size_t size): * cdef int ret = msgpack_pack_array(&self.pk, size) # <<<<<<<<<<<<<< * if ret == -1: * raise MemoryError */ __pyx_v_ret = msgpack_pack_array((&__pyx_v_self->pk), __pyx_v_size);
261: if ret == -1:
/* "pandas/msgpack.pyx":261
* def pack_array_header(self, size_t size):
* cdef int ret = msgpack_pack_array(&self.pk, size)
* if ret == -1: # <<<<<<<<<<<<<<
* raise MemoryError
* elif ret: # should not happen
*/
__pyx_t_1 = ((__pyx_v_ret == -1) != 0);
if (__pyx_t_1) {
262: raise MemoryError
/* "pandas/msgpack.pyx":262
* cdef int ret = msgpack_pack_array(&self.pk, size)
* if ret == -1:
* raise MemoryError # <<<<<<<<<<<<<<
* elif ret: # should not happen
* raise TypeError
*/
PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
263: elif ret: # should not happen
/* "pandas/msgpack.pyx":263
* if ret == -1:
* raise MemoryError
* elif ret: # should not happen # <<<<<<<<<<<<<<
* raise TypeError
* if self.autoreset:
*/
__pyx_t_1 = (__pyx_v_ret != 0);
if (__pyx_t_1) {
264: raise TypeError
/* "pandas/msgpack.pyx":264
* raise MemoryError
* elif ret: # should not happen
* raise TypeError # <<<<<<<<<<<<<<
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
*/
__Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
265: if self.autoreset:
/* "pandas/msgpack.pyx":265
* elif ret: # should not happen
* raise TypeError
* if self.autoreset: # <<<<<<<<<<<<<<
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0
*/
__pyx_t_1 = (__pyx_v_self->autoreset != 0);
if (__pyx_t_1) {
266: buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
/* "pandas/msgpack.pyx":266
* raise TypeError
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<<
* self.pk.length = 0
* return buf
*/
__pyx_t_2 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_buf = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
267: self.pk.length = 0
/* "pandas/msgpack.pyx":267
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0 # <<<<<<<<<<<<<<
* return buf
*
*/
__pyx_v_self->pk.length = 0;
268: return buf
/* "pandas/msgpack.pyx":268
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0
* return buf # <<<<<<<<<<<<<<
*
* def pack_map_header(self, size_t size):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_buf);
__pyx_r = __pyx_v_buf;
goto __pyx_L0;
}
269:
270: def pack_map_header(self, size_t size):
/* "pandas/msgpack.pyx":270
* return buf
*
* def pack_map_header(self, size_t size): # <<<<<<<<<<<<<<
* cdef int ret = msgpack_pack_map(&self.pk, size)
* if ret == -1:
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_11pack_map_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size); /*proto*/
static char __pyx_doc_6pandas_7msgpack_6Packer_10pack_map_header[] = "Packer.pack_map_header(self, size_t size)";
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_11pack_map_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_size) {
size_t __pyx_v_size;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack_map_header (wrapper)", 0);
assert(__pyx_arg_size); {
__pyx_v_size = __Pyx_PyInt_As_size_t(__pyx_arg_size); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.Packer.pack_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_10pack_map_header(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((size_t)__pyx_v_size));
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_10pack_map_header(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, size_t __pyx_v_size) {
int __pyx_v_ret;
PyObject *__pyx_v_buf = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack_map_header", 0);
/* "pandas/msgpack.pyx":270
* return buf
*
* def pack_map_header(self, size_t size): # <<<<<<<<<<<<<<
* cdef int ret = msgpack_pack_map(&self.pk, size)
* if ret == -1:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pandas.msgpack.Packer.pack_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_buf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
271: cdef int ret = msgpack_pack_map(&self.pk, size)
/* "pandas/msgpack.pyx":271 * * def pack_map_header(self, size_t size): * cdef int ret = msgpack_pack_map(&self.pk, size) # <<<<<<<<<<<<<< * if ret == -1: * raise MemoryError */ __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_v_size);
272: if ret == -1:
/* "pandas/msgpack.pyx":272
* def pack_map_header(self, size_t size):
* cdef int ret = msgpack_pack_map(&self.pk, size)
* if ret == -1: # <<<<<<<<<<<<<<
* raise MemoryError
* elif ret: # should not happen
*/
__pyx_t_1 = ((__pyx_v_ret == -1) != 0);
if (__pyx_t_1) {
273: raise MemoryError
/* "pandas/msgpack.pyx":273
* cdef int ret = msgpack_pack_map(&self.pk, size)
* if ret == -1:
* raise MemoryError # <<<<<<<<<<<<<<
* elif ret: # should not happen
* raise TypeError
*/
PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
274: elif ret: # should not happen
/* "pandas/msgpack.pyx":274
* if ret == -1:
* raise MemoryError
* elif ret: # should not happen # <<<<<<<<<<<<<<
* raise TypeError
* if self.autoreset:
*/
__pyx_t_1 = (__pyx_v_ret != 0);
if (__pyx_t_1) {
275: raise TypeError
/* "pandas/msgpack.pyx":275
* raise MemoryError
* elif ret: # should not happen
* raise TypeError # <<<<<<<<<<<<<<
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
*/
__Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
276: if self.autoreset:
/* "pandas/msgpack.pyx":276
* elif ret: # should not happen
* raise TypeError
* if self.autoreset: # <<<<<<<<<<<<<<
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0
*/
__pyx_t_1 = (__pyx_v_self->autoreset != 0);
if (__pyx_t_1) {
277: buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
/* "pandas/msgpack.pyx":277
* raise TypeError
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<<
* self.pk.length = 0
* return buf
*/
__pyx_t_2 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_buf = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
278: self.pk.length = 0
/* "pandas/msgpack.pyx":278
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0 # <<<<<<<<<<<<<<
* return buf
*
*/
__pyx_v_self->pk.length = 0;
279: return buf
/* "pandas/msgpack.pyx":279
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0
* return buf # <<<<<<<<<<<<<<
*
* def pack_map_pairs(self, object pairs):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_buf);
__pyx_r = __pyx_v_buf;
goto __pyx_L0;
}
280:
281: def pack_map_pairs(self, object pairs):
/* "pandas/msgpack.pyx":281
* return buf
*
* def pack_map_pairs(self, object pairs): # <<<<<<<<<<<<<<
* """
* Pack *pairs* as msgpack map type.
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_13pack_map_pairs(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static char __pyx_doc_6pandas_7msgpack_6Packer_12pack_map_pairs[] = "Packer.pack_map_pairs(self, pairs)\n\n Pack *pairs* as msgpack map type.\n\n *pairs* should sequence of pair.\n (`len(pairs)` and `for k, v in *pairs*:` should be supported.)\n ";
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_13pack_map_pairs(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack_map_pairs (wrapper)", 0);
__pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_12pack_map_pairs(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self), ((PyObject *)__pyx_v_pairs));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_12pack_map_pairs(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_pairs) {
int __pyx_v_ret;
PyObject *__pyx_v_k = NULL;
PyObject *__pyx_v_v = NULL;
PyObject *__pyx_v_buf = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack_map_pairs", 0);
/* "pandas/msgpack.pyx":281
* return buf
*
* def pack_map_pairs(self, object pairs): # <<<<<<<<<<<<<<
* """
* Pack *pairs* as msgpack map type.
*/
/* 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_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("pandas.msgpack.Packer.pack_map_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_k);
__Pyx_XDECREF(__pyx_v_v);
__Pyx_XDECREF(__pyx_v_buf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
282: """
283: Pack *pairs* as msgpack map type.
284:
285: *pairs* should sequence of pair.
286: (`len(pairs)` and `for k, v in *pairs*:` should be supported.)
287: """
288: cdef int ret = msgpack_pack_map(&self.pk, len(pairs))
/* "pandas/msgpack.pyx":288 * (`len(pairs)` and `for k, v in *pairs*:` should be supported.) * """ * cdef int ret = msgpack_pack_map(&self.pk, len(pairs)) # <<<<<<<<<<<<<< * if ret == 0: * for k, v in pairs: */ __pyx_t_1 = PyObject_Length(__pyx_v_pairs); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ret = msgpack_pack_map((&__pyx_v_self->pk), __pyx_t_1);
289: if ret == 0:
/* "pandas/msgpack.pyx":289
* """
* cdef int ret = msgpack_pack_map(&self.pk, len(pairs))
* if ret == 0: # <<<<<<<<<<<<<<
* for k, v in pairs:
* ret = self._pack(k)
*/
__pyx_t_2 = ((__pyx_v_ret == 0) != 0);
if (__pyx_t_2) {
290: for k, v in pairs:
/* "pandas/msgpack.pyx":290
* cdef int ret = msgpack_pack_map(&self.pk, len(pairs))
* if ret == 0:
* for k, v in pairs: # <<<<<<<<<<<<<<
* ret = self._pack(k)
* if ret != 0: break
*/
if (PyList_CheckExact(__pyx_v_pairs) || PyTuple_CheckExact(__pyx_v_pairs)) {
__pyx_t_3 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
__pyx_t_4 = NULL;
} else {
__pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
for (;;) {
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_3);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
PyObject* sequence = __pyx_t_5;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
#endif
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
__pyx_t_7 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
#else
__pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
#endif
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L7_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6);
__pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
__pyx_t_7 = 0;
291: ret = self._pack(k)
/* "pandas/msgpack.pyx":291
* if ret == 0:
* for k, v in pairs:
* ret = self._pack(k) # <<<<<<<<<<<<<<
* if ret != 0: break
* ret = self._pack(v)
*/
__pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, NULL); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_10;
292: if ret != 0: break
/* "pandas/msgpack.pyx":292
* for k, v in pairs:
* ret = self._pack(k)
* if ret != 0: break # <<<<<<<<<<<<<<
* ret = self._pack(v)
* if ret != 0: break
*/
__pyx_t_2 = ((__pyx_v_ret != 0) != 0);
if (__pyx_t_2) {
goto __pyx_L5_break;
}
293: ret = self._pack(v)
/* "pandas/msgpack.pyx":293
* ret = self._pack(k)
* if ret != 0: break
* ret = self._pack(v) # <<<<<<<<<<<<<<
* if ret != 0: break
* if ret == -1:
*/
__pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, NULL); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_10;
294: if ret != 0: break
/* "pandas/msgpack.pyx":294
* if ret != 0: break
* ret = self._pack(v)
* if ret != 0: break # <<<<<<<<<<<<<<
* if ret == -1:
* raise MemoryError
*/
__pyx_t_2 = ((__pyx_v_ret != 0) != 0);
if (__pyx_t_2) {
goto __pyx_L5_break;
}
}
__pyx_L5_break:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L3;
}
__pyx_L3:;
295: if ret == -1:
/* "pandas/msgpack.pyx":295
* ret = self._pack(v)
* if ret != 0: break
* if ret == -1: # <<<<<<<<<<<<<<
* raise MemoryError
* elif ret: # should not happen
*/
__pyx_t_2 = ((__pyx_v_ret == -1) != 0);
if (__pyx_t_2) {
296: raise MemoryError
/* "pandas/msgpack.pyx":296
* if ret != 0: break
* if ret == -1:
* raise MemoryError # <<<<<<<<<<<<<<
* elif ret: # should not happen
* raise TypeError
*/
PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
297: elif ret: # should not happen
/* "pandas/msgpack.pyx":297
* if ret == -1:
* raise MemoryError
* elif ret: # should not happen # <<<<<<<<<<<<<<
* raise TypeError
* if self.autoreset:
*/
__pyx_t_2 = (__pyx_v_ret != 0);
if (__pyx_t_2) {
298: raise TypeError
/* "pandas/msgpack.pyx":298
* raise MemoryError
* elif ret: # should not happen
* raise TypeError # <<<<<<<<<<<<<<
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
*/
__Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
299: if self.autoreset:
/* "pandas/msgpack.pyx":299
* elif ret: # should not happen
* raise TypeError
* if self.autoreset: # <<<<<<<<<<<<<<
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0
*/
__pyx_t_2 = (__pyx_v_self->autoreset != 0);
if (__pyx_t_2) {
300: buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
/* "pandas/msgpack.pyx":300
* raise TypeError
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<<
* self.pk.length = 0
* return buf
*/
__pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_buf = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
301: self.pk.length = 0
/* "pandas/msgpack.pyx":301
* if self.autoreset:
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0 # <<<<<<<<<<<<<<
* return buf
*
*/
__pyx_v_self->pk.length = 0;
302: return buf
/* "pandas/msgpack.pyx":302
* buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
* self.pk.length = 0
* return buf # <<<<<<<<<<<<<<
*
* def reset(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_buf);
__pyx_r = __pyx_v_buf;
goto __pyx_L0;
}
303:
304: def reset(self):
/* "pandas/msgpack.pyx":304
* return buf
*
* def reset(self): # <<<<<<<<<<<<<<
* """Clear internal buffer."""
* self.pk.length = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pandas_7msgpack_6Packer_14reset[] = "Packer.reset(self)\nClear internal buffer.";
static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
__pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_14reset(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_14reset(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset", 0);
/* "pandas/msgpack.pyx":304
* return buf
*
* def reset(self): # <<<<<<<<<<<<<<
* """Clear internal buffer."""
* self.pk.length = 0
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
305: """Clear internal buffer."""
306: self.pk.length = 0
/* "pandas/msgpack.pyx":306 * def reset(self): * """Clear internal buffer.""" * self.pk.length = 0 # <<<<<<<<<<<<<< * * def bytes(self): */ __pyx_v_self->pk.length = 0;
307:
308: def bytes(self):
/* "pandas/msgpack.pyx":308 * self.pk.length = 0 * * def bytes(self): # <<<<<<<<<<<<<< * """Return buffer content.""" * return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) */ /* Python wrapper */ static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_17bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pandas_7msgpack_6Packer_16bytes[] = "Packer.bytes(self)\nReturn buffer content."; static PyObject *__pyx_pw_6pandas_7msgpack_6Packer_17bytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bytes (wrapper)", 0); __pyx_r = __pyx_pf_6pandas_7msgpack_6Packer_16bytes(((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pandas_7msgpack_6Packer_16bytes(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bytes", 0); /* "pandas/msgpack.pyx":308 * self.pk.length = 0 * * def bytes(self): # <<<<<<<<<<<<<< * """Return buffer content.""" * return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pandas.msgpack.Packer.bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
309: """Return buffer content."""
310: return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
/* "pandas/msgpack.pyx":310 * def bytes(self): * """Return buffer content.""" * return PyBytes_FromStringAndSize(self.pk.buf, self.pk.length) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->pk.buf, __pyx_v_self->pk.length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
311:
312:
313: cdef inline pack_pair(self, object k, object v, int nest_limit):
/* "pandas/msgpack.pyx":313
*
*
* cdef inline pack_pair(self, object k, object v, int nest_limit): # <<<<<<<<<<<<<<
* ret = self._pack(k, nest_limit-1)
* if ret != 0: raise PackException("cannot pack : %s" % k)
*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_6Packer_pack_pair(struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_self, PyObject *__pyx_v_k, PyObject *__pyx_v_v, int __pyx_v_nest_limit) {
int __pyx_v_ret;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack_pair", 0);
/* "pandas/msgpack.pyx":313
*
*
* cdef inline pack_pair(self, object k, object v, int nest_limit): # <<<<<<<<<<<<<<
* ret = self._pack(k, nest_limit-1)
* if ret != 0: raise PackException("cannot pack : %s" % k)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("pandas.msgpack.Packer.pack_pair", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
314: ret = self._pack(k, nest_limit-1)
/* "pandas/msgpack.pyx":314
*
* cdef inline pack_pair(self, object k, object v, int nest_limit):
* ret = self._pack(k, nest_limit-1) # <<<<<<<<<<<<<<
* if ret != 0: raise PackException("cannot pack : %s" % k)
* ret = self._pack(v, nest_limit-1)
*/
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.nest_limit = (__pyx_v_nest_limit - 1);
__pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_k, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_1;
315: if ret != 0: raise PackException("cannot pack : %s" % k)
/* "pandas/msgpack.pyx":315
* cdef inline pack_pair(self, object k, object v, int nest_limit):
* ret = self._pack(k, nest_limit-1)
* if ret != 0: raise PackException("cannot pack : %s" % k) # <<<<<<<<<<<<<<
* ret = self._pack(v, nest_limit-1)
* if ret != 0: raise PackException("cannot pack : %s" % v)
*/
__pyx_t_3 = ((__pyx_v_ret != 0) != 0);
if (__pyx_t_3) {
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_cannot_pack_s, __pyx_v_k); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__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_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
316: ret = self._pack(v, nest_limit-1)
/* "pandas/msgpack.pyx":316
* ret = self._pack(k, nest_limit-1)
* if ret != 0: raise PackException("cannot pack : %s" % k)
* ret = self._pack(v, nest_limit-1) # <<<<<<<<<<<<<<
* if ret != 0: raise PackException("cannot pack : %s" % v)
* return ret
*/
__pyx_t_2.__pyx_n = 1;
__pyx_t_2.nest_limit = (__pyx_v_nest_limit - 1);
__pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_self->__pyx_vtab)->_pack(__pyx_v_self, __pyx_v_v, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_1;
317: if ret != 0: raise PackException("cannot pack : %s" % v)
/* "pandas/msgpack.pyx":317
* if ret != 0: raise PackException("cannot pack : %s" % k)
* ret = self._pack(v, nest_limit-1)
* if ret != 0: raise PackException("cannot pack : %s" % v) # <<<<<<<<<<<<<<
* return ret
*
*/
__pyx_t_3 = ((__pyx_v_ret != 0) != 0);
if (__pyx_t_3) {
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PackException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_cannot_pack_s, __pyx_v_v); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __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;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
318: return ret
/* "pandas/msgpack.pyx":318
* ret = self._pack(v, nest_limit-1)
* if ret != 0: raise PackException("cannot pack : %s" % v)
* return ret # <<<<<<<<<<<<<<
*
* def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
319:
320: def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'):
/* "pandas/msgpack.pyx":320
* return ret
*
* def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<<
* """
* pack an object `o` and write it to stream)."""
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_1pack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_7msgpack_pack[] = "pack(o, stream, default=None, encoding='utf-8', unicode_errors='strict')\n\n pack an object `o` and write it to stream).";
static PyMethodDef __pyx_mdef_6pandas_7msgpack_1pack = {__Pyx_NAMESTR("pack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_1pack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_pack)};
static PyObject *__pyx_pw_6pandas_7msgpack_1pack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_o = 0;
PyObject *__pyx_v_stream = 0;
PyObject *__pyx_v_default = 0;
PyObject *__pyx_v_encoding = 0;
PyObject *__pyx_v_unicode_errors = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_o,&__pyx_n_s_stream,&__pyx_n_s_default,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,0};
PyObject* values[5] = {0,0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)__pyx_kp_s_utf_8);
values[4] = ((PyObject *)__pyx_n_s_strict);
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);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("pack", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
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_o = values[0];
__pyx_v_stream = values[1];
__pyx_v_default = values[2];
__pyx_v_encoding = values[3];
__pyx_v_unicode_errors = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("pack", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.pack", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_pack(__pyx_self, __pyx_v_o, __pyx_v_stream, __pyx_v_default, __pyx_v_encoding, __pyx_v_unicode_errors);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_pack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_stream, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors) {
struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_packer = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pack", 0);
/* "pandas/msgpack.pyx":320
* return ret
*
* def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<<
* """
* pack an object `o` and write it to stream)."""
*/
/* 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("pandas.msgpack.pack", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_packer);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "pandas/msgpack.pyx":320
* return ret
*
* def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<<
* """
* pack an object `o` and write it to stream)."""
*/
__pyx_tuple__33 = PyTuple_Pack(6, __pyx_n_s_o, __pyx_n_s_stream, __pyx_n_s_default, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_packer); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__33);
__Pyx_GIVEREF(__pyx_tuple__33);
/* "pandas/msgpack.pyx":320
* return ret
*
* def pack(object o, object stream, default=None, encoding='utf-8', unicode_errors='strict'): # <<<<<<<<<<<<<<
* """
* pack an object `o` and write it to stream)."""
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_1pack, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pack, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mnt_home_jreback_pandas_pandas, __pyx_n_s_pack, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
321: """
322: pack an object `o` and write it to stream)."""
323: packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors)
/* "pandas/msgpack.pyx":323 * """ * pack an object `o` and write it to stream).""" * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors) # <<<<<<<<<<<<<< * stream.write(packer.pack(o)) * */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_default, __pyx_v_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unicode_errors, __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7msgpack_Packer)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_packer = ((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_t_2); __pyx_t_2 = 0;
324: stream.write(packer.pack(o))
/* "pandas/msgpack.pyx":324 * pack an object `o` and write it to stream).""" * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors) * stream.write(packer.pack(o)) # <<<<<<<<<<<<<< * * def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_packer->__pyx_vtab)->pack(__pyx_v_packer, __pyx_v_o, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
325:
326: def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False):
/* "pandas/msgpack.pyx":326
* stream.write(packer.pack(o))
*
* def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<<
* """
* pack o and return packed bytes."""
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_3packb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_7msgpack_2packb[] = "packb(o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False)\n\n pack o and return packed bytes.";
static PyMethodDef __pyx_mdef_6pandas_7msgpack_3packb = {__Pyx_NAMESTR("packb"), (PyCFunction)__pyx_pw_6pandas_7msgpack_3packb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_2packb)};
static PyObject *__pyx_pw_6pandas_7msgpack_3packb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_o = 0;
PyObject *__pyx_v_default = 0;
PyObject *__pyx_v_encoding = 0;
PyObject *__pyx_v_unicode_errors = 0;
PyObject *__pyx_v_use_single_float = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("packb (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_o,&__pyx_n_s_default,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_use_single_float,0};
PyObject* values[5] = {0,0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)__pyx_kp_s_utf_8);
values[3] = ((PyObject *)__pyx_n_s_strict);
values[4] = ((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 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
if (value) { values[1] = value; kw_args--; }
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_single_float);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "packb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_o = values[0];
__pyx_v_default = values[1];
__pyx_v_encoding = values[2];
__pyx_v_unicode_errors = values[3];
__pyx_v_use_single_float = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("packb", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.packb", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_2packb(__pyx_self, __pyx_v_o, __pyx_v_default, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_use_single_float);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_2packb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o, PyObject *__pyx_v_default, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_use_single_float) {
struct __pyx_obj_6pandas_7msgpack_Packer *__pyx_v_packer = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("packb", 0);
/* "pandas/msgpack.pyx":326
* stream.write(packer.pack(o))
*
* def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<<
* """
* pack o and return packed bytes."""
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pandas.msgpack.packb", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_packer);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "pandas/msgpack.pyx":326
* stream.write(packer.pack(o))
*
* def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<<
* """
* pack o and return packed bytes."""
*/
__pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_s_o, __pyx_n_s_default, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_use_single_float, __pyx_n_s_packer); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__35);
__Pyx_GIVEREF(__pyx_tuple__35);
/* "pandas/msgpack.pyx":326
* stream.write(packer.pack(o))
*
* def packb(object o, default=None, encoding='utf-8', unicode_errors='strict', use_single_float=False): # <<<<<<<<<<<<<<
* """
* pack o and return packed bytes."""
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_3packb, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_packb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mnt_home_jreback_pandas_pandas, __pyx_n_s_packb, 326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
327: """
328: pack o and return packed bytes."""
329: packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors,
/* "pandas/msgpack.pyx":329 * """ * pack o and return packed bytes.""" * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, # <<<<<<<<<<<<<< * use_single_float=use_single_float) * return packer.pack(o) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_default, __pyx_v_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unicode_errors, __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pandas/msgpack.pyx":329 * """ * pack o and return packed bytes.""" * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, # <<<<<<<<<<<<<< * use_single_float=use_single_float) * return packer.pack(o) */ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_7msgpack_Packer)), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_packer = ((struct __pyx_obj_6pandas_7msgpack_Packer *)__pyx_t_2); __pyx_t_2 = 0;
330: use_single_float=use_single_float)
/* "pandas/msgpack.pyx":330 * pack o and return packed bytes.""" * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, * use_single_float=use_single_float) # <<<<<<<<<<<<<< * return packer.pack(o) * */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_use_single_float, __pyx_v_use_single_float) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
331: return packer.pack(o)
/* "pandas/msgpack.pyx":331 * packer = Packer(default=default, encoding=encoding, unicode_errors=unicode_errors, * use_single_float=use_single_float) * return packer.pack(o) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Packer *)__pyx_v_packer->__pyx_vtab)->pack(__pyx_v_packer, __pyx_v_o, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0;
332:
333:
334: cdef inline init_ctx(template_context *ctx,
/* "pandas/msgpack.pyx":334
*
*
* cdef inline init_ctx(template_context *ctx, # <<<<<<<<<<<<<<
* object object_hook, object object_pairs_hook, object list_hook,
* bint use_list, char* encoding, char* unicode_errors):
*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_7msgpack_init_ctx(template_context *__pyx_v_ctx, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, char *__pyx_v_encoding, char *__pyx_v_unicode_errors) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("init_ctx", 0);
/* "pandas/msgpack.pyx":334
*
*
* cdef inline init_ctx(template_context *ctx, # <<<<<<<<<<<<<<
* object object_hook, object object_pairs_hook, object list_hook,
* bint use_list, char* encoding, char* unicode_errors):
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pandas.msgpack.init_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
335: object object_hook, object object_pairs_hook, object list_hook,
336: bint use_list, char* encoding, char* unicode_errors):
337: template_init(ctx)
/* "pandas/msgpack.pyx":337 * object object_hook, object object_pairs_hook, object list_hook, * bint use_list, char* encoding, char* unicode_errors): * template_init(ctx) # <<<<<<<<<<<<<< * ctx.user.use_list = use_list * ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL */ template_init(__pyx_v_ctx);
338: ctx.user.use_list = use_list
/* "pandas/msgpack.pyx":338 * bint use_list, char* encoding, char* unicode_errors): * template_init(ctx) * ctx.user.use_list = use_list # <<<<<<<<<<<<<< * ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL * */ __pyx_v_ctx->user.use_list = __pyx_v_use_list;
339: ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL
/* "pandas/msgpack.pyx":339 * template_init(ctx) * ctx.user.use_list = use_list * ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL # <<<<<<<<<<<<<< * * if object_hook is not None and object_pairs_hook is not None: */ __pyx_v_ctx->user.object_hook = ((PyObject *)NULL); __pyx_v_ctx->user.list_hook = ((PyObject *)NULL);
340:
341: if object_hook is not None and object_pairs_hook is not None:
/* "pandas/msgpack.pyx":341
* ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL
*
* if object_hook is not None and object_pairs_hook is not None: # <<<<<<<<<<<<<<
* raise ValueError("object_pairs_hook and object_hook are mutually exclusive.")
*
*/
__pyx_t_1 = (__pyx_v_object_hook != Py_None);
if ((__pyx_t_1 != 0)) {
__pyx_t_2 = (__pyx_v_object_pairs_hook != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
} else {
__pyx_t_3 = (__pyx_t_1 != 0);
}
if (__pyx_t_3) {
342: raise ValueError("object_pairs_hook and object_hook are mutually exclusive.")
/* "pandas/msgpack.pyx":342
*
* if object_hook is not None and object_pairs_hook is not None:
* raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") # <<<<<<<<<<<<<<
*
* if object_hook is not None:
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":342
*
* if object_hook is not None and object_pairs_hook is not None:
* raise ValueError("object_pairs_hook and object_hook are mutually exclusive.") # <<<<<<<<<<<<<<
*
* if object_hook is not None:
*/
__pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_object_pairs_hook_and_object_hoo); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
343:
344: if object_hook is not None:
/* "pandas/msgpack.pyx":344
* raise ValueError("object_pairs_hook and object_hook are mutually exclusive.")
*
* if object_hook is not None: # <<<<<<<<<<<<<<
* if not PyCallable_Check(object_hook):
* raise TypeError("object_hook must be a callable.")
*/
__pyx_t_3 = (__pyx_v_object_hook != Py_None);
__pyx_t_1 = (__pyx_t_3 != 0);
if (__pyx_t_1) {
345: if not PyCallable_Check(object_hook):
/* "pandas/msgpack.pyx":345
*
* if object_hook is not None:
* if not PyCallable_Check(object_hook): # <<<<<<<<<<<<<<
* raise TypeError("object_hook must be a callable.")
* ctx.user.object_hook = <PyObject*>object_hook
*/
__pyx_t_1 = ((!(PyCallable_Check(__pyx_v_object_hook) != 0)) != 0);
if (__pyx_t_1) {
346: raise TypeError("object_hook must be a callable.")
/* "pandas/msgpack.pyx":346
* if object_hook is not None:
* if not PyCallable_Check(object_hook):
* raise TypeError("object_hook must be a callable.") # <<<<<<<<<<<<<<
* ctx.user.object_hook = <PyObject*>object_hook
*
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":346
* if object_hook is not None:
* if not PyCallable_Check(object_hook):
* raise TypeError("object_hook must be a callable.") # <<<<<<<<<<<<<<
* ctx.user.object_hook = <PyObject*>object_hook
*
*/
__pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_object_hook_must_be_a_callable); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
347: ctx.user.object_hook = <PyObject*>object_hook
/* "pandas/msgpack.pyx":347
* if not PyCallable_Check(object_hook):
* raise TypeError("object_hook must be a callable.")
* ctx.user.object_hook = <PyObject*>object_hook # <<<<<<<<<<<<<<
*
* if object_pairs_hook is None:
*/
__pyx_v_ctx->user.object_hook = ((PyObject *)__pyx_v_object_hook);
goto __pyx_L4;
}
__pyx_L4:;
348:
349: if object_pairs_hook is None:
/* "pandas/msgpack.pyx":349
* ctx.user.object_hook = <PyObject*>object_hook
*
* if object_pairs_hook is None: # <<<<<<<<<<<<<<
* ctx.user.has_pairs_hook = False
* else:
*/
__pyx_t_1 = (__pyx_v_object_pairs_hook == Py_None);
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
350: ctx.user.has_pairs_hook = False
/* "pandas/msgpack.pyx":350
*
* if object_pairs_hook is None:
* ctx.user.has_pairs_hook = False # <<<<<<<<<<<<<<
* else:
* if not PyCallable_Check(object_pairs_hook):
*/
__pyx_v_ctx->user.has_pairs_hook = 0;
goto __pyx_L6;
}
/*else*/ {
351: else:
352: if not PyCallable_Check(object_pairs_hook):
/* "pandas/msgpack.pyx":352
* ctx.user.has_pairs_hook = False
* else:
* if not PyCallable_Check(object_pairs_hook): # <<<<<<<<<<<<<<
* raise TypeError("object_pairs_hook must be a callable.")
* ctx.user.object_hook = <PyObject*>object_pairs_hook
*/
__pyx_t_3 = ((!(PyCallable_Check(__pyx_v_object_pairs_hook) != 0)) != 0);
if (__pyx_t_3) {
353: raise TypeError("object_pairs_hook must be a callable.")
/* "pandas/msgpack.pyx":353
* else:
* if not PyCallable_Check(object_pairs_hook):
* raise TypeError("object_pairs_hook must be a callable.") # <<<<<<<<<<<<<<
* ctx.user.object_hook = <PyObject*>object_pairs_hook
* ctx.user.has_pairs_hook = True
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":353
* else:
* if not PyCallable_Check(object_pairs_hook):
* raise TypeError("object_pairs_hook must be a callable.") # <<<<<<<<<<<<<<
* ctx.user.object_hook = <PyObject*>object_pairs_hook
* ctx.user.has_pairs_hook = True
*/
__pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_object_pairs_hook_must_be_a_call); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__10);
__Pyx_GIVEREF(__pyx_tuple__10);
354: ctx.user.object_hook = <PyObject*>object_pairs_hook
/* "pandas/msgpack.pyx":354
* if not PyCallable_Check(object_pairs_hook):
* raise TypeError("object_pairs_hook must be a callable.")
* ctx.user.object_hook = <PyObject*>object_pairs_hook # <<<<<<<<<<<<<<
* ctx.user.has_pairs_hook = True
*
*/
__pyx_v_ctx->user.object_hook = ((PyObject *)__pyx_v_object_pairs_hook);
355: ctx.user.has_pairs_hook = True
/* "pandas/msgpack.pyx":355
* raise TypeError("object_pairs_hook must be a callable.")
* ctx.user.object_hook = <PyObject*>object_pairs_hook
* ctx.user.has_pairs_hook = True # <<<<<<<<<<<<<<
*
* if list_hook is not None:
*/
__pyx_v_ctx->user.has_pairs_hook = 1;
}
__pyx_L6:;
356:
357: if list_hook is not None:
/* "pandas/msgpack.pyx":357
* ctx.user.has_pairs_hook = True
*
* if list_hook is not None: # <<<<<<<<<<<<<<
* if not PyCallable_Check(list_hook):
* raise TypeError("list_hook must be a callable.")
*/
__pyx_t_3 = (__pyx_v_list_hook != Py_None);
__pyx_t_1 = (__pyx_t_3 != 0);
if (__pyx_t_1) {
358: if not PyCallable_Check(list_hook):
/* "pandas/msgpack.pyx":358
*
* if list_hook is not None:
* if not PyCallable_Check(list_hook): # <<<<<<<<<<<<<<
* raise TypeError("list_hook must be a callable.")
* ctx.user.list_hook = <PyObject*>list_hook
*/
__pyx_t_1 = ((!(PyCallable_Check(__pyx_v_list_hook) != 0)) != 0);
if (__pyx_t_1) {
359: raise TypeError("list_hook must be a callable.")
/* "pandas/msgpack.pyx":359
* if list_hook is not None:
* if not PyCallable_Check(list_hook):
* raise TypeError("list_hook must be a callable.") # <<<<<<<<<<<<<<
* ctx.user.list_hook = <PyObject*>list_hook
*
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":359
* if list_hook is not None:
* if not PyCallable_Check(list_hook):
* raise TypeError("list_hook must be a callable.") # <<<<<<<<<<<<<<
* ctx.user.list_hook = <PyObject*>list_hook
*
*/
__pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_list_hook_must_be_a_callable); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
360: ctx.user.list_hook = <PyObject*>list_hook
/* "pandas/msgpack.pyx":360
* if not PyCallable_Check(list_hook):
* raise TypeError("list_hook must be a callable.")
* ctx.user.list_hook = <PyObject*>list_hook # <<<<<<<<<<<<<<
*
* ctx.user.encoding = encoding
*/
__pyx_v_ctx->user.list_hook = ((PyObject *)__pyx_v_list_hook);
goto __pyx_L8;
}
__pyx_L8:;
361:
362: ctx.user.encoding = encoding
/* "pandas/msgpack.pyx":362 * ctx.user.list_hook = <PyObject*>list_hook * * ctx.user.encoding = encoding # <<<<<<<<<<<<<< * ctx.user.unicode_errors = unicode_errors * */ __pyx_v_ctx->user.encoding = __pyx_v_encoding;
363: ctx.user.unicode_errors = unicode_errors
/* "pandas/msgpack.pyx":363 * * ctx.user.encoding = encoding * ctx.user.unicode_errors = unicode_errors # <<<<<<<<<<<<<< * * def unpackb(object packed, object object_hook=None, object list_hook=None, */ __pyx_v_ctx->user.unicode_errors = __pyx_v_unicode_errors;
364:
365: def unpackb(object packed, object object_hook=None, object list_hook=None,
/* "pandas/msgpack.pyx":365
* ctx.user.unicode_errors = unicode_errors
*
* def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None,
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_5unpackb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_7msgpack_4unpackb[] = "unpackb(packed, object_hook=None, list_hook=None, bool use_list=1, encoding=None, unicode_errors='strict', object_pairs_hook=None)\nUnpack packed_bytes to object. Returns an unpacked object.\n\n Raises `ValueError` when `packed` contains extra bytes.\n ";
static PyMethodDef __pyx_mdef_6pandas_7msgpack_5unpackb = {__Pyx_NAMESTR("unpackb"), (PyCFunction)__pyx_pw_6pandas_7msgpack_5unpackb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_4unpackb)};
static PyObject *__pyx_pw_6pandas_7msgpack_5unpackb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_packed = 0;
PyObject *__pyx_v_object_hook = 0;
PyObject *__pyx_v_list_hook = 0;
int __pyx_v_use_list;
PyObject *__pyx_v_encoding = 0;
PyObject *__pyx_v_unicode_errors = 0;
PyObject *__pyx_v_object_pairs_hook = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("unpackb (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_packed,&__pyx_n_s_object_hook,&__pyx_n_s_list_hook,&__pyx_n_s_use_list,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_object_pairs_hook,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
/* "pandas/msgpack.pyx":365
* ctx.user.unicode_errors = unicode_errors
*
* def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None,
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_4unpackb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_packed, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook) {
template_context __pyx_v_ctx;
size_t __pyx_v_off;
int __pyx_v_ret;
char *__pyx_v_buf;
Py_ssize_t __pyx_v_buf_len;
char *__pyx_v_cenc;
char *__pyx_v_cerr;
PyObject *__pyx_v_obj = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("unpackb", 0);
__Pyx_INCREF(__pyx_v_encoding);
__Pyx_INCREF(__pyx_v_unicode_errors);
/* "pandas/msgpack.pyx":365
* ctx.user.unicode_errors = unicode_errors
*
* def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pandas.msgpack.unpackb", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_obj);
__Pyx_XDECREF(__pyx_v_encoding);
__Pyx_XDECREF(__pyx_v_unicode_errors);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "pandas/msgpack.pyx":365
* ctx.user.unicode_errors = unicode_errors
*
* def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None,
*/
__pyx_tuple__37 = PyTuple_Pack(15, __pyx_n_s_packed, __pyx_n_s_object_hook, __pyx_n_s_list_hook, __pyx_n_s_use_list, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_object_pairs_hook, __pyx_n_s_ctx, __pyx_n_s_off, __pyx_n_s_ret, __pyx_n_s_buf, __pyx_n_s_buf_len, __pyx_n_s_cenc, __pyx_n_s_cerr, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__37);
__Pyx_GIVEREF(__pyx_tuple__37);
/* "pandas/msgpack.pyx":365
* ctx.user.unicode_errors = unicode_errors
*
* def unpackb(object packed, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None,
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_5unpackb, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpackb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mnt_home_jreback_pandas_pandas, __pyx_n_s_unpackb, 365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
366: bint use_list=1, encoding=None, unicode_errors="strict",
/* "pandas/msgpack.pyx":366
*
* def unpackb(object packed, object object_hook=None, object list_hook=None,
* bint use_list=1, encoding=None, unicode_errors="strict", # <<<<<<<<<<<<<<
* object_pairs_hook=None,
* ):
*/
values[4] = ((PyObject *)Py_None);
values[5] = ((PyObject *)__pyx_n_s_strict);
367: object_pairs_hook=None,
/* "pandas/msgpack.pyx":367
* def unpackb(object packed, object object_hook=None, object list_hook=None,
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None, # <<<<<<<<<<<<<<
* ):
* """Unpack packed_bytes to object. Returns an unpacked object.
*/
values[6] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_packed)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_hook);
if (value) { values[1] = value; kw_args--; }
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_hook);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_list);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
if (value) { values[4] = value; kw_args--; }
}
case 5:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors);
if (value) { values[5] = value; kw_args--; }
}
case 6:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_pairs_hook);
if (value) { values[6] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpackb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_packed = values[0];
__pyx_v_object_hook = values[1];
__pyx_v_list_hook = values[2];
if (values[3]) {
__pyx_v_use_list = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_use_list = ((int)1);
}
__pyx_v_encoding = values[4];
__pyx_v_unicode_errors = values[5];
__pyx_v_object_pairs_hook = values[6];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("unpackb", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.unpackb", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_4unpackb(__pyx_self, __pyx_v_packed, __pyx_v_object_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_object_pairs_hook);
368: ):
369: """Unpack packed_bytes to object. Returns an unpacked object.
370:
371: Raises `ValueError` when `packed` contains extra bytes.
372: """
373: cdef template_context ctx
374: cdef size_t off = 0
/* "pandas/msgpack.pyx":374 * """ * cdef template_context ctx * cdef size_t off = 0 # <<<<<<<<<<<<<< * cdef int ret * */ __pyx_v_off = 0;
375: cdef int ret
376:
377: cdef char* buf
378: cdef Py_ssize_t buf_len
379: cdef char* cenc = NULL
/* "pandas/msgpack.pyx":379 * cdef char* buf * cdef Py_ssize_t buf_len * cdef char* cenc = NULL # <<<<<<<<<<<<<< * cdef char* cerr = NULL * */ __pyx_v_cenc = NULL;
380: cdef char* cerr = NULL
/* "pandas/msgpack.pyx":380
* cdef Py_ssize_t buf_len
* cdef char* cenc = NULL
* cdef char* cerr = NULL # <<<<<<<<<<<<<<
*
* PyObject_AsReadBuffer(packed, <const_void_ptr*>&buf, &buf_len)
*/
__pyx_v_cerr = NULL;
381:
382: PyObject_AsReadBuffer(packed, <const_void_ptr*>&buf, &buf_len)
/* "pandas/msgpack.pyx":382 * cdef char* cerr = NULL * * PyObject_AsReadBuffer(packed, <const_void_ptr*>&buf, &buf_len) # <<<<<<<<<<<<<< * * if encoding is not None: */ __pyx_t_1 = PyObject_AsReadBuffer(__pyx_v_packed, ((const void* *)(&__pyx_v_buf)), (&__pyx_v_buf_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
383:
384: if encoding is not None:
/* "pandas/msgpack.pyx":384
* PyObject_AsReadBuffer(packed, <const_void_ptr*>&buf, &buf_len)
*
* if encoding is not None: # <<<<<<<<<<<<<<
* if isinstance(encoding, unicode):
* encoding = encoding.encode('ascii')
*/
__pyx_t_2 = (__pyx_v_encoding != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
385: if isinstance(encoding, unicode):
/* "pandas/msgpack.pyx":385
*
* if encoding is not None:
* if isinstance(encoding, unicode): # <<<<<<<<<<<<<<
* encoding = encoding.encode('ascii')
* cenc = PyBytes_AsString(encoding)
*/
__pyx_t_3 = PyUnicode_Check(__pyx_v_encoding);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
386: encoding = encoding.encode('ascii')
/* "pandas/msgpack.pyx":386
* if encoding is not None:
* if isinstance(encoding, unicode):
* encoding = encoding.encode('ascii') # <<<<<<<<<<<<<<
* cenc = PyBytes_AsString(encoding)
*
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L4;
}
__pyx_L4:;
/* "pandas/msgpack.pyx":386
* if encoding is not None:
* if isinstance(encoding, unicode):
* encoding = encoding.encode('ascii') # <<<<<<<<<<<<<<
* cenc = PyBytes_AsString(encoding)
*
*/
__pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__12);
__Pyx_GIVEREF(__pyx_tuple__12);
387: cenc = PyBytes_AsString(encoding)
/* "pandas/msgpack.pyx":387
* if isinstance(encoding, unicode):
* encoding = encoding.encode('ascii')
* cenc = PyBytes_AsString(encoding) # <<<<<<<<<<<<<<
*
* if unicode_errors is not None:
*/
__pyx_t_6 = PyBytes_AsString(__pyx_v_encoding); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_cenc = __pyx_t_6;
goto __pyx_L3;
}
__pyx_L3:;
388:
389: if unicode_errors is not None:
/* "pandas/msgpack.pyx":389
* cenc = PyBytes_AsString(encoding)
*
* if unicode_errors is not None: # <<<<<<<<<<<<<<
* if isinstance(unicode_errors, unicode):
* unicode_errors = unicode_errors.encode('ascii')
*/
__pyx_t_2 = (__pyx_v_unicode_errors != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
390: if isinstance(unicode_errors, unicode):
/* "pandas/msgpack.pyx":390
*
* if unicode_errors is not None:
* if isinstance(unicode_errors, unicode): # <<<<<<<<<<<<<<
* unicode_errors = unicode_errors.encode('ascii')
* cerr = PyBytes_AsString(unicode_errors)
*/
__pyx_t_3 = PyUnicode_Check(__pyx_v_unicode_errors);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
391: unicode_errors = unicode_errors.encode('ascii')
/* "pandas/msgpack.pyx":391
* if unicode_errors is not None:
* if isinstance(unicode_errors, unicode):
* unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<<
* cerr = PyBytes_AsString(unicode_errors)
*
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicode_errors, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_unicode_errors, __pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L6;
}
__pyx_L6:;
/* "pandas/msgpack.pyx":391
* if unicode_errors is not None:
* if isinstance(unicode_errors, unicode):
* unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<<
* cerr = PyBytes_AsString(unicode_errors)
*
*/
__pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__13);
__Pyx_GIVEREF(__pyx_tuple__13);
392: cerr = PyBytes_AsString(unicode_errors)
/* "pandas/msgpack.pyx":392
* if isinstance(unicode_errors, unicode):
* unicode_errors = unicode_errors.encode('ascii')
* cerr = PyBytes_AsString(unicode_errors) # <<<<<<<<<<<<<<
*
* init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
*/
__pyx_t_6 = PyBytes_AsString(__pyx_v_unicode_errors); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_cerr = __pyx_t_6;
goto __pyx_L5;
}
__pyx_L5:;
393:
394: init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
/* "pandas/msgpack.pyx":394 * cerr = PyBytes_AsString(unicode_errors) * * init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) # <<<<<<<<<<<<<< * ret = template_construct(&ctx, buf, buf_len, &off) * if ret == 1: */ __pyx_t_4 = __pyx_f_6pandas_7msgpack_init_ctx((&__pyx_v_ctx), __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_cenc, __pyx_v_cerr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
395: ret = template_construct(&ctx, buf, buf_len, &off)
/* "pandas/msgpack.pyx":395
*
* init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
* ret = template_construct(&ctx, buf, buf_len, &off) # <<<<<<<<<<<<<<
* if ret == 1:
* obj = template_data(&ctx)
*/
__pyx_t_1 = template_construct((&__pyx_v_ctx), __pyx_v_buf, __pyx_v_buf_len, (&__pyx_v_off)); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_1;
396: if ret == 1:
/* "pandas/msgpack.pyx":396
* init_ctx(&ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
* ret = template_construct(&ctx, buf, buf_len, &off)
* if ret == 1: # <<<<<<<<<<<<<<
* obj = template_data(&ctx)
* if off < buf_len:
*/
__pyx_t_2 = ((__pyx_v_ret == 1) != 0);
if (__pyx_t_2) {
397: obj = template_data(&ctx)
/* "pandas/msgpack.pyx":397
* ret = template_construct(&ctx, buf, buf_len, &off)
* if ret == 1:
* obj = template_data(&ctx) # <<<<<<<<<<<<<<
* if off < buf_len:
* raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
*/
__pyx_t_4 = template_data((&__pyx_v_ctx)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_obj = __pyx_t_4;
__pyx_t_4 = 0;
398: if off < buf_len:
/* "pandas/msgpack.pyx":398
* if ret == 1:
* obj = template_data(&ctx)
* if off < buf_len: # <<<<<<<<<<<<<<
* raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
* return obj
*/
__pyx_t_2 = ((__pyx_v_off < __pyx_v_buf_len) != 0);
if (__pyx_t_2) {
399: raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
/* "pandas/msgpack.pyx":399
* obj = template_data(&ctx)
* if off < buf_len:
* raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off)) # <<<<<<<<<<<<<<
* return obj
* elif ret < 0:
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ExtraData); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyBytes_FromStringAndSize((__pyx_v_buf + __pyx_v_off), (__pyx_v_buf_len - __pyx_v_off)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_obj);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_v_obj);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
400: return obj
/* "pandas/msgpack.pyx":400
* if off < buf_len:
* raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
* return obj # <<<<<<<<<<<<<<
* elif ret < 0:
* raise ValueError("Unpack failed: error = %d" % (ret,))
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_obj);
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
}
401: elif ret < 0:
/* "pandas/msgpack.pyx":401
* raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
* return obj
* elif ret < 0: # <<<<<<<<<<<<<<
* raise ValueError("Unpack failed: error = %d" % (ret,))
* else:
*/
__pyx_t_2 = ((__pyx_v_ret < 0) != 0);
if (__pyx_t_2) {
402: raise ValueError("Unpack failed: error = %d" % (ret,))
/* "pandas/msgpack.pyx":402
* return obj
* elif ret < 0:
* raise ValueError("Unpack failed: error = %d" % (ret,)) # <<<<<<<<<<<<<<
* else:
* raise UnpackValueError
*/
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unpack_failed_error_d, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/*else*/ {
403: else:
404: raise UnpackValueError
/* "pandas/msgpack.pyx":404
* raise ValueError("Unpack failed: error = %d" % (ret,))
* else:
* raise UnpackValueError # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnpackValueError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
405:
406:
407: def unpack(object stream, object object_hook=None, object list_hook=None,
/* "pandas/msgpack.pyx":407
*
*
* def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None,
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_7unpack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_7msgpack_6unpack[] = "unpack(stream, object_hook=None, list_hook=None, bool use_list=1, encoding=None, unicode_errors='strict', object_pairs_hook=None)\nUnpack an object from `stream`.\n\n Raises `ValueError` when `stream` has extra bytes.\n ";
static PyMethodDef __pyx_mdef_6pandas_7msgpack_7unpack = {__Pyx_NAMESTR("unpack"), (PyCFunction)__pyx_pw_6pandas_7msgpack_7unpack, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_7msgpack_6unpack)};
static PyObject *__pyx_pw_6pandas_7msgpack_7unpack(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_stream = 0;
PyObject *__pyx_v_object_hook = 0;
PyObject *__pyx_v_list_hook = 0;
int __pyx_v_use_list;
PyObject *__pyx_v_encoding = 0;
PyObject *__pyx_v_unicode_errors = 0;
PyObject *__pyx_v_object_pairs_hook = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("unpack (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_object_hook,&__pyx_n_s_list_hook,&__pyx_n_s_use_list,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_object_pairs_hook,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
/* "pandas/msgpack.pyx":407
*
*
* def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None,
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_6unpack(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_list_hook, int __pyx_v_use_list, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, PyObject *__pyx_v_object_pairs_hook) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("unpack", 0);
/* "pandas/msgpack.pyx":407
*
*
* def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=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("pandas.msgpack.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "pandas/msgpack.pyx":407
*
*
* def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None,
*/
__pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_s_stream, __pyx_n_s_object_hook, __pyx_n_s_list_hook, __pyx_n_s_use_list, __pyx_n_s_encoding, __pyx_n_s_unicode_errors, __pyx_n_s_object_pairs_hook); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__39);
__Pyx_GIVEREF(__pyx_tuple__39);
/* "pandas/msgpack.pyx":407
*
*
* def unpack(object stream, object object_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None,
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_7msgpack_7unpack, NULL, __pyx_n_s_pandas_msgpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
408: bint use_list=1, encoding=None, unicode_errors="strict",
/* "pandas/msgpack.pyx":408
*
* def unpack(object stream, object object_hook=None, object list_hook=None,
* bint use_list=1, encoding=None, unicode_errors="strict", # <<<<<<<<<<<<<<
* object_pairs_hook=None,
* ):
*/
values[4] = ((PyObject *)Py_None);
values[5] = ((PyObject *)__pyx_n_s_strict);
409: object_pairs_hook=None,
/* "pandas/msgpack.pyx":409
* def unpack(object stream, object object_hook=None, object list_hook=None,
* bint use_list=1, encoding=None, unicode_errors="strict",
* object_pairs_hook=None, # <<<<<<<<<<<<<<
* ):
* """Unpack an object from `stream`.
*/
values[6] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
case 1:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_hook);
if (value) { values[1] = value; kw_args--; }
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_hook);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_list);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
if (value) { values[4] = value; kw_args--; }
}
case 5:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors);
if (value) { values[5] = value; kw_args--; }
}
case 6:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_pairs_hook);
if (value) { values[6] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_stream = values[0];
__pyx_v_object_hook = values[1];
__pyx_v_list_hook = values[2];
if (values[3]) {
__pyx_v_use_list = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_use_list = ((int)1);
}
__pyx_v_encoding = values[4];
__pyx_v_unicode_errors = values[5];
__pyx_v_object_pairs_hook = values[6];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("unpack", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_6unpack(__pyx_self, __pyx_v_stream, __pyx_v_object_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_object_pairs_hook);
410: ):
411: """Unpack an object from `stream`.
412:
413: Raises `ValueError` when `stream` has extra bytes.
414: """
415: return unpackb(stream.read(), use_list=use_list,
/* "pandas/msgpack.pyx":415 * Raises `ValueError` when `stream` has extra bytes. * """ * return unpackb(stream.read(), use_list=use_list, # <<<<<<<<<<<<<< * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, * encoding=encoding, unicode_errors=unicode_errors, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unpackb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_use_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_use_list, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pandas/msgpack.pyx":415 * Raises `ValueError` when `stream` has extra bytes. * """ * return unpackb(stream.read(), use_list=use_list, # <<<<<<<<<<<<<< * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, * encoding=encoding, unicode_errors=unicode_errors, */ __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __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;
416: object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook,
/* "pandas/msgpack.pyx":416 * """ * return unpackb(stream.read(), use_list=use_list, * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, # <<<<<<<<<<<<<< * encoding=encoding, unicode_errors=unicode_errors, * ) */ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_object_hook, __pyx_v_object_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_object_pairs_hook, __pyx_v_object_pairs_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_list_hook, __pyx_v_list_hook) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
417: encoding=encoding, unicode_errors=unicode_errors,
/* "pandas/msgpack.pyx":417 * return unpackb(stream.read(), use_list=use_list, * object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook, * encoding=encoding, unicode_errors=unicode_errors, # <<<<<<<<<<<<<< * ) * */ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unicode_errors, __pyx_v_unicode_errors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
418: )
419:
420:
421: cdef class Unpacker(object):
/* "pandas/msgpack.pyx":421
*
*
* cdef class Unpacker(object): # <<<<<<<<<<<<<<
* """
* Streaming unpacker.
*/
struct __pyx_obj_6pandas_7msgpack_Unpacker {
PyObject_HEAD
struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *__pyx_vtab;
template_context ctx;
char *buf;
size_t buf_size;
size_t buf_head;
size_t buf_tail;
PyObject *file_like;
PyObject *file_like_read;
Py_ssize_t read_size;
PyObject *object_hook;
PyObject *encoding;
PyObject *unicode_errors;
size_t max_buffer_size;
};
struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker {
PyObject *(*append_buffer)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, void *, Py_ssize_t);
PyObject *(*read_from_file)(struct __pyx_obj_6pandas_7msgpack_Unpacker *);
PyObject *(*_unpack)(struct __pyx_obj_6pandas_7msgpack_Unpacker *, execute_fn, PyObject *, struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack *__pyx_optional_args);
};
static struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *__pyx_vtabptr_6pandas_7msgpack_Unpacker;
422: """
423: Streaming unpacker.
424:
425: `file_like` is a file-like object having `.read(n)` method.
426: When `Unpacker` initialized with `file_like`, unpacker reads serialized data
427: from it and `.feed()` method is not usable.
428:
429: `read_size` is used as `file_like.read(read_size)`.
430: (default: min(1024**2, max_buffer_size))
431:
432: If `use_list` is true (default), msgpack list is deserialized to Python list.
433: Otherwise, it is deserialized to Python tuple.
434:
435: `object_hook` is same to simplejson. If it is not None, it should be callable
436: and Unpacker calls it with a dict argument after deserializing a map.
437:
438: `object_pairs_hook` is same to simplejson. If it is not None, it should be callable
439: and Unpacker calls it with a list of key-value pairs after deserializing a map.
440:
441: `encoding` is encoding used for decoding msgpack bytes. If it is None (default),
442: msgpack bytes is deserialized to Python bytes.
443:
444: `unicode_errors` is used for decoding bytes.
445:
446: `max_buffer_size` limits size of data waiting unpacked.
447: 0 means system's INT_MAX (default).
448: Raises `BufferFull` exception when it is insufficient.
449: You shoud set this parameter when unpacking data from untrasted source.
450:
451: example of streaming deserialize from file-like object::
452:
453: unpacker = Unpacker(file_like)
454: for o in unpacker:
455: do_something(o)
456:
457: example of streaming deserialize from socket::
458:
459: unpacker = Unpacker()
460: while 1:
461: buf = sock.recv(1024**2)
462: if not buf:
463: break
464: unpacker.feed(buf)
465: for o in unpacker:
466: do_something(o)
467: """
468: cdef template_context ctx
469: cdef char* buf
470: cdef size_t buf_size, buf_head, buf_tail
471: cdef object file_like
472: cdef object file_like_read
473: cdef Py_ssize_t read_size
474: cdef object object_hook
475: cdef object encoding, unicode_errors
476: cdef size_t max_buffer_size
477:
478: def __cinit__(self):
/* "pandas/msgpack.pyx":478
* cdef size_t max_buffer_size
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.buf = NULL
*
*/
/* Python wrapper */
static int __pyx_pw_6pandas_7msgpack_8Unpacker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_7msgpack_8Unpacker_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_6pandas_7msgpack_8Unpacker___cinit__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_6pandas_7msgpack_8Unpacker___cinit__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "pandas/msgpack.pyx":478
* cdef size_t max_buffer_size
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.buf = NULL
*
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
479: self.buf = NULL
/* "pandas/msgpack.pyx":479 * * def __cinit__(self): * self.buf = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->buf = NULL;
480:
481: def __dealloc__(self):
/* "pandas/msgpack.pyx":481
* self.buf = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* free(self.buf)
* self.buf = NULL
*/
/* Python wrapper */
static void __pyx_pw_6pandas_7msgpack_8Unpacker_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6pandas_7msgpack_8Unpacker_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_6pandas_7msgpack_8Unpacker_2__dealloc__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_6pandas_7msgpack_8Unpacker_2__dealloc__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "pandas/msgpack.pyx":481
* self.buf = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* free(self.buf)
* self.buf = NULL
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
}
482: free(self.buf)
/* "pandas/msgpack.pyx":482 * * def __dealloc__(self): * free(self.buf) # <<<<<<<<<<<<<< * self.buf = NULL * */ free(__pyx_v_self->buf);
483: self.buf = NULL
/* "pandas/msgpack.pyx":483 * def __dealloc__(self): * free(self.buf) * self.buf = NULL # <<<<<<<<<<<<<< * * def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, */ __pyx_v_self->buf = NULL;
484:
485: def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1,
/* "pandas/msgpack.pyx":485
* self.buf = NULL
*
* def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, # <<<<<<<<<<<<<<
* object object_hook=None, object object_pairs_hook=None, object list_hook=None,
* encoding=None, unicode_errors='strict', int max_buffer_size=0,
*/
/* Python wrapper */
static int __pyx_pw_6pandas_7msgpack_8Unpacker_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6pandas_7msgpack_8Unpacker_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_file_like = 0;
Py_ssize_t __pyx_v_read_size;
int __pyx_v_use_list;
PyObject *__pyx_v_object_hook = 0;
PyObject *__pyx_v_object_pairs_hook = 0;
PyObject *__pyx_v_list_hook = 0;
PyObject *__pyx_v_encoding = 0;
PyObject *__pyx_v_unicode_errors = 0;
int __pyx_v_max_buffer_size;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_like,&__pyx_n_s_read_size,&__pyx_n_s_use_list,&__pyx_n_s_object_hook,&__pyx_n_s_object_pairs_hook,&__pyx_n_s_list_hook,&__pyx_n_s_encoding,&__pyx_n_s_unicode_errors,&__pyx_n_s_max_buffer_size,0};
PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
values[0] = ((PyObject *)Py_None);
/* "pandas/msgpack.pyx":485
* self.buf = NULL
*
* def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, # <<<<<<<<<<<<<<
* object object_hook=None, object object_pairs_hook=None, object list_hook=None,
* encoding=None, unicode_errors='strict', int max_buffer_size=0,
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_6pandas_7msgpack_8Unpacker_4__init__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_file_like, Py_ssize_t __pyx_v_read_size, int __pyx_v_use_list, PyObject *__pyx_v_object_hook, PyObject *__pyx_v_object_pairs_hook, PyObject *__pyx_v_list_hook, PyObject *__pyx_v_encoding, PyObject *__pyx_v_unicode_errors, int __pyx_v_max_buffer_size) {
char *__pyx_v_cenc;
char *__pyx_v_cerr;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
__Pyx_INCREF(__pyx_v_encoding);
__Pyx_INCREF(__pyx_v_unicode_errors);
/* "pandas/msgpack.pyx":485
* self.buf = NULL
*
* def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1, # <<<<<<<<<<<<<<
* object object_hook=None, object object_pairs_hook=None, object list_hook=None,
* encoding=None, unicode_errors='strict', int max_buffer_size=0,
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("pandas.msgpack.Unpacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_encoding);
__Pyx_XDECREF(__pyx_v_unicode_errors);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
486: object object_hook=None, object object_pairs_hook=None, object list_hook=None,
/* "pandas/msgpack.pyx":486
*
* def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1,
* object object_hook=None, object object_pairs_hook=None, object list_hook=None, # <<<<<<<<<<<<<<
* encoding=None, unicode_errors='strict', int max_buffer_size=0,
* ):
*/
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
values[5] = ((PyObject *)Py_None);
487: encoding=None, unicode_errors='strict', int max_buffer_size=0,
/* "pandas/msgpack.pyx":487
* def __init__(self, file_like=None, Py_ssize_t read_size=0, bint use_list=1,
* object object_hook=None, object object_pairs_hook=None, object list_hook=None,
* encoding=None, unicode_errors='strict', int max_buffer_size=0, # <<<<<<<<<<<<<<
* ):
* cdef char *cenc=NULL, *cerr=NULL
*/
values[6] = ((PyObject *)Py_None);
values[7] = ((PyObject *)__pyx_n_s_strict);
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);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_like);
if (value) { values[0] = value; kw_args--; }
}
case 1:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_read_size);
if (value) { values[1] = value; kw_args--; }
}
case 2:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_list);
if (value) { values[2] = value; kw_args--; }
}
case 3:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_hook);
if (value) { values[3] = value; kw_args--; }
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_object_pairs_hook);
if (value) { values[4] = value; kw_args--; }
}
case 5:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_hook);
if (value) { values[5] = value; kw_args--; }
}
case 6:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
if (value) { values[6] = value; kw_args--; }
}
case 7:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unicode_errors);
if (value) { values[7] = value; kw_args--; }
}
case 8:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_buffer_size);
if (value) { values[8] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_file_like = values[0];
if (values[1]) {
__pyx_v_read_size = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_read_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_read_size = ((Py_ssize_t)0);
}
if (values[2]) {
__pyx_v_use_list = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_use_list == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_use_list = ((int)1);
}
__pyx_v_object_hook = values[3];
__pyx_v_object_pairs_hook = values[4];
__pyx_v_list_hook = values[5];
__pyx_v_encoding = values[6];
__pyx_v_unicode_errors = values[7];
if (values[8]) {
__pyx_v_max_buffer_size = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_max_buffer_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_max_buffer_size = ((int)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.Unpacker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_4__init__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_file_like, __pyx_v_read_size, __pyx_v_use_list, __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_encoding, __pyx_v_unicode_errors, __pyx_v_max_buffer_size);
488: ):
489: cdef char *cenc=NULL, *cerr=NULL
/* "pandas/msgpack.pyx":489 * encoding=None, unicode_errors='strict', int max_buffer_size=0, * ): * cdef char *cenc=NULL, *cerr=NULL # <<<<<<<<<<<<<< * * self.file_like = file_like */ __pyx_v_cenc = NULL; __pyx_v_cerr = NULL;
490:
491: self.file_like = file_like
/* "pandas/msgpack.pyx":491 * cdef char *cenc=NULL, *cerr=NULL * * self.file_like = file_like # <<<<<<<<<<<<<< * if file_like: * self.file_like_read = file_like.read */ __Pyx_INCREF(__pyx_v_file_like); __Pyx_GIVEREF(__pyx_v_file_like); __Pyx_GOTREF(__pyx_v_self->file_like); __Pyx_DECREF(__pyx_v_self->file_like); __pyx_v_self->file_like = __pyx_v_file_like;
492: if file_like:
/* "pandas/msgpack.pyx":492 * * self.file_like = file_like * if file_like: # <<<<<<<<<<<<<< * self.file_like_read = file_like.read * if not PyCallable_Check(self.file_like_read): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_file_like); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) {
493: self.file_like_read = file_like.read
/* "pandas/msgpack.pyx":493
* self.file_like = file_like
* if file_like:
* self.file_like_read = file_like.read # <<<<<<<<<<<<<<
* if not PyCallable_Check(self.file_like_read):
* raise ValueError("`file_like.read` must be a callable.")
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->file_like_read);
__Pyx_DECREF(__pyx_v_self->file_like_read);
__pyx_v_self->file_like_read = __pyx_t_2;
__pyx_t_2 = 0;
494: if not PyCallable_Check(self.file_like_read):
/* "pandas/msgpack.pyx":494
* if file_like:
* self.file_like_read = file_like.read
* if not PyCallable_Check(self.file_like_read): # <<<<<<<<<<<<<<
* raise ValueError("`file_like.read` must be a callable.")
* if not max_buffer_size:
*/
__pyx_t_2 = __pyx_v_self->file_like_read;
__Pyx_INCREF(__pyx_t_2);
__pyx_t_1 = ((!(PyCallable_Check(__pyx_t_2) != 0)) != 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_1) {
495: raise ValueError("`file_like.read` must be a callable.")
/* "pandas/msgpack.pyx":495
* self.file_like_read = file_like.read
* if not PyCallable_Check(self.file_like_read):
* raise ValueError("`file_like.read` must be a callable.") # <<<<<<<<<<<<<<
* if not max_buffer_size:
* max_buffer_size = INT_MAX
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
goto __pyx_L3;
}
__pyx_L3:;
/* "pandas/msgpack.pyx":495
* self.file_like_read = file_like.read
* if not PyCallable_Check(self.file_like_read):
* raise ValueError("`file_like.read` must be a callable.") # <<<<<<<<<<<<<<
* if not max_buffer_size:
* max_buffer_size = INT_MAX
*/
__pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_file_like_read_must_be_a_callab); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__14);
__Pyx_GIVEREF(__pyx_tuple__14);
496: if not max_buffer_size:
/* "pandas/msgpack.pyx":496
* if not PyCallable_Check(self.file_like_read):
* raise ValueError("`file_like.read` must be a callable.")
* if not max_buffer_size: # <<<<<<<<<<<<<<
* max_buffer_size = INT_MAX
* if read_size > max_buffer_size:
*/
__pyx_t_1 = ((!(__pyx_v_max_buffer_size != 0)) != 0);
if (__pyx_t_1) {
497: max_buffer_size = INT_MAX
/* "pandas/msgpack.pyx":497
* raise ValueError("`file_like.read` must be a callable.")
* if not max_buffer_size:
* max_buffer_size = INT_MAX # <<<<<<<<<<<<<<
* if read_size > max_buffer_size:
* raise ValueError("read_size should be less or equal to max_buffer_size")
*/
__pyx_v_max_buffer_size = INT_MAX;
goto __pyx_L5;
}
__pyx_L5:;
498: if read_size > max_buffer_size:
/* "pandas/msgpack.pyx":498
* if not max_buffer_size:
* max_buffer_size = INT_MAX
* if read_size > max_buffer_size: # <<<<<<<<<<<<<<
* raise ValueError("read_size should be less or equal to max_buffer_size")
* if not read_size:
*/
__pyx_t_1 = ((__pyx_v_read_size > __pyx_v_max_buffer_size) != 0);
if (__pyx_t_1) {
499: raise ValueError("read_size should be less or equal to max_buffer_size")
/* "pandas/msgpack.pyx":499
* max_buffer_size = INT_MAX
* if read_size > max_buffer_size:
* raise ValueError("read_size should be less or equal to max_buffer_size") # <<<<<<<<<<<<<<
* if not read_size:
* read_size = min(max_buffer_size, 1024**2)
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":499
* max_buffer_size = INT_MAX
* if read_size > max_buffer_size:
* raise ValueError("read_size should be less or equal to max_buffer_size") # <<<<<<<<<<<<<<
* if not read_size:
* read_size = min(max_buffer_size, 1024**2)
*/
__pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_read_size_should_be_less_or_equa); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__15);
__Pyx_GIVEREF(__pyx_tuple__15);
500: if not read_size:
/* "pandas/msgpack.pyx":500
* if read_size > max_buffer_size:
* raise ValueError("read_size should be less or equal to max_buffer_size")
* if not read_size: # <<<<<<<<<<<<<<
* read_size = min(max_buffer_size, 1024**2)
* self.max_buffer_size = max_buffer_size
*/
__pyx_t_1 = ((!(__pyx_v_read_size != 0)) != 0);
if (__pyx_t_1) {
501: read_size = min(max_buffer_size, 1024**2)
/* "pandas/msgpack.pyx":501
* raise ValueError("read_size should be less or equal to max_buffer_size")
* if not read_size:
* read_size = min(max_buffer_size, 1024**2) # <<<<<<<<<<<<<<
* self.max_buffer_size = max_buffer_size
* self.read_size = read_size
*/
__pyx_t_3 = 1048576;
__pyx_t_4 = __pyx_v_max_buffer_size;
if (((__pyx_t_3 < __pyx_t_4) != 0)) {
__pyx_t_5 = __pyx_t_3;
} else {
__pyx_t_5 = __pyx_t_4;
}
__pyx_v_read_size = __pyx_t_5;
goto __pyx_L7;
}
__pyx_L7:;
502: self.max_buffer_size = max_buffer_size
/* "pandas/msgpack.pyx":502 * if not read_size: * read_size = min(max_buffer_size, 1024**2) * self.max_buffer_size = max_buffer_size # <<<<<<<<<<<<<< * self.read_size = read_size * self.buf = <char*>malloc(read_size) */ __pyx_v_self->max_buffer_size = __pyx_v_max_buffer_size;
503: self.read_size = read_size
/* "pandas/msgpack.pyx":503 * read_size = min(max_buffer_size, 1024**2) * self.max_buffer_size = max_buffer_size * self.read_size = read_size # <<<<<<<<<<<<<< * self.buf = <char*>malloc(read_size) * if self.buf == NULL: */ __pyx_v_self->read_size = __pyx_v_read_size;
504: self.buf = <char*>malloc(read_size)
/* "pandas/msgpack.pyx":504
* self.max_buffer_size = max_buffer_size
* self.read_size = read_size
* self.buf = <char*>malloc(read_size) # <<<<<<<<<<<<<<
* if self.buf == NULL:
* raise MemoryError("Unable to allocate internal buffer.")
*/
__pyx_v_self->buf = ((char *)malloc(__pyx_v_read_size));
505: if self.buf == NULL:
/* "pandas/msgpack.pyx":505
* self.read_size = read_size
* self.buf = <char*>malloc(read_size)
* if self.buf == NULL: # <<<<<<<<<<<<<<
* raise MemoryError("Unable to allocate internal buffer.")
* self.buf_size = read_size
*/
__pyx_t_1 = ((__pyx_v_self->buf == NULL) != 0);
if (__pyx_t_1) {
506: raise MemoryError("Unable to allocate internal buffer.")
/* "pandas/msgpack.pyx":506
* self.buf = <char*>malloc(read_size)
* if self.buf == NULL:
* raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<<
* self.buf_size = read_size
* self.buf_head = 0
*/
__pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":506
* self.buf = <char*>malloc(read_size)
* if self.buf == NULL:
* raise MemoryError("Unable to allocate internal buffer.") # <<<<<<<<<<<<<<
* self.buf_size = read_size
* self.buf_head = 0
*/
__pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_allocate_internal_buff); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__16);
__Pyx_GIVEREF(__pyx_tuple__16);
507: self.buf_size = read_size
/* "pandas/msgpack.pyx":507
* if self.buf == NULL:
* raise MemoryError("Unable to allocate internal buffer.")
* self.buf_size = read_size # <<<<<<<<<<<<<<
* self.buf_head = 0
* self.buf_tail = 0
*/
__pyx_v_self->buf_size = __pyx_v_read_size;
508: self.buf_head = 0
/* "pandas/msgpack.pyx":508
* raise MemoryError("Unable to allocate internal buffer.")
* self.buf_size = read_size
* self.buf_head = 0 # <<<<<<<<<<<<<<
* self.buf_tail = 0
*
*/
__pyx_v_self->buf_head = 0;
509: self.buf_tail = 0
/* "pandas/msgpack.pyx":509 * self.buf_size = read_size * self.buf_head = 0 * self.buf_tail = 0 # <<<<<<<<<<<<<< * * if encoding is not None: */ __pyx_v_self->buf_tail = 0;
510:
511: if encoding is not None:
/* "pandas/msgpack.pyx":511
* self.buf_tail = 0
*
* if encoding is not None: # <<<<<<<<<<<<<<
* if isinstance(encoding, unicode):
* encoding = encoding.encode('ascii')
*/
__pyx_t_1 = (__pyx_v_encoding != Py_None);
__pyx_t_6 = (__pyx_t_1 != 0);
if (__pyx_t_6) {
512: if isinstance(encoding, unicode):
/* "pandas/msgpack.pyx":512
*
* if encoding is not None:
* if isinstance(encoding, unicode): # <<<<<<<<<<<<<<
* encoding = encoding.encode('ascii')
* self.encoding = encoding
*/
__pyx_t_6 = PyUnicode_Check(__pyx_v_encoding);
__pyx_t_1 = (__pyx_t_6 != 0);
if (__pyx_t_1) {
513: encoding = encoding.encode('ascii')
/* "pandas/msgpack.pyx":513
* if encoding is not None:
* if isinstance(encoding, unicode):
* encoding = encoding.encode('ascii') # <<<<<<<<<<<<<<
* self.encoding = encoding
* cenc = PyBytes_AsString(encoding)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = PyObject_Call(__pyx_t_2, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_7);
__pyx_t_7 = 0;
goto __pyx_L10;
}
__pyx_L10:;
/* "pandas/msgpack.pyx":513
* if encoding is not None:
* if isinstance(encoding, unicode):
* encoding = encoding.encode('ascii') # <<<<<<<<<<<<<<
* self.encoding = encoding
* cenc = PyBytes_AsString(encoding)
*/
__pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__17);
__Pyx_GIVEREF(__pyx_tuple__17);
514: self.encoding = encoding
/* "pandas/msgpack.pyx":514
* if isinstance(encoding, unicode):
* encoding = encoding.encode('ascii')
* self.encoding = encoding # <<<<<<<<<<<<<<
* cenc = PyBytes_AsString(encoding)
*
*/
__Pyx_INCREF(__pyx_v_encoding);
__Pyx_GIVEREF(__pyx_v_encoding);
__Pyx_GOTREF(__pyx_v_self->encoding);
__Pyx_DECREF(__pyx_v_self->encoding);
__pyx_v_self->encoding = __pyx_v_encoding;
515: cenc = PyBytes_AsString(encoding)
/* "pandas/msgpack.pyx":515
* encoding = encoding.encode('ascii')
* self.encoding = encoding
* cenc = PyBytes_AsString(encoding) # <<<<<<<<<<<<<<
*
* if unicode_errors is not None:
*/
__pyx_t_8 = PyBytes_AsString(__pyx_v_encoding); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_cenc = __pyx_t_8;
goto __pyx_L9;
}
__pyx_L9:;
516:
517: if unicode_errors is not None:
/* "pandas/msgpack.pyx":517
* cenc = PyBytes_AsString(encoding)
*
* if unicode_errors is not None: # <<<<<<<<<<<<<<
* if isinstance(unicode_errors, unicode):
* unicode_errors = unicode_errors.encode('ascii')
*/
__pyx_t_1 = (__pyx_v_unicode_errors != Py_None);
__pyx_t_6 = (__pyx_t_1 != 0);
if (__pyx_t_6) {
518: if isinstance(unicode_errors, unicode):
/* "pandas/msgpack.pyx":518
*
* if unicode_errors is not None:
* if isinstance(unicode_errors, unicode): # <<<<<<<<<<<<<<
* unicode_errors = unicode_errors.encode('ascii')
* self.unicode_errors = unicode_errors
*/
__pyx_t_6 = PyUnicode_Check(__pyx_v_unicode_errors);
__pyx_t_1 = (__pyx_t_6 != 0);
if (__pyx_t_1) {
519: unicode_errors = unicode_errors.encode('ascii')
/* "pandas/msgpack.pyx":519
* if unicode_errors is not None:
* if isinstance(unicode_errors, unicode):
* unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<<
* self.unicode_errors = unicode_errors
* cerr = PyBytes_AsString(unicode_errors)
*/
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicode_errors, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_2 = PyObject_Call(__pyx_t_7, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF_SET(__pyx_v_unicode_errors, __pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L12;
}
__pyx_L12:;
/* "pandas/msgpack.pyx":519
* if unicode_errors is not None:
* if isinstance(unicode_errors, unicode):
* unicode_errors = unicode_errors.encode('ascii') # <<<<<<<<<<<<<<
* self.unicode_errors = unicode_errors
* cerr = PyBytes_AsString(unicode_errors)
*/
__pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__18);
__Pyx_GIVEREF(__pyx_tuple__18);
520: self.unicode_errors = unicode_errors
/* "pandas/msgpack.pyx":520
* if isinstance(unicode_errors, unicode):
* unicode_errors = unicode_errors.encode('ascii')
* self.unicode_errors = unicode_errors # <<<<<<<<<<<<<<
* cerr = PyBytes_AsString(unicode_errors)
*
*/
__Pyx_INCREF(__pyx_v_unicode_errors);
__Pyx_GIVEREF(__pyx_v_unicode_errors);
__Pyx_GOTREF(__pyx_v_self->unicode_errors);
__Pyx_DECREF(__pyx_v_self->unicode_errors);
__pyx_v_self->unicode_errors = __pyx_v_unicode_errors;
521: cerr = PyBytes_AsString(unicode_errors)
/* "pandas/msgpack.pyx":521
* unicode_errors = unicode_errors.encode('ascii')
* self.unicode_errors = unicode_errors
* cerr = PyBytes_AsString(unicode_errors) # <<<<<<<<<<<<<<
*
* init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
*/
__pyx_t_8 = PyBytes_AsString(__pyx_v_unicode_errors); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_cerr = __pyx_t_8;
goto __pyx_L11;
}
__pyx_L11:;
522:
523: init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
/* "pandas/msgpack.pyx":523 * cerr = PyBytes_AsString(unicode_errors) * * init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr) # <<<<<<<<<<<<<< * * def feed(self, object next_bytes): */ __pyx_t_2 = __pyx_f_6pandas_7msgpack_init_ctx((&__pyx_v_self->ctx), __pyx_v_object_hook, __pyx_v_object_pairs_hook, __pyx_v_list_hook, __pyx_v_use_list, __pyx_v_cenc, __pyx_v_cerr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
524:
525: def feed(self, object next_bytes):
/* "pandas/msgpack.pyx":525
* init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
*
* def feed(self, object next_bytes): # <<<<<<<<<<<<<<
* """Append `next_bytes` to internal buffer."""
* cdef char* buf
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_7feed(PyObject *__pyx_v_self, PyObject *__pyx_v_next_bytes); /*proto*/
static char __pyx_doc_6pandas_7msgpack_8Unpacker_6feed[] = "Unpacker.feed(self, next_bytes)\nAppend `next_bytes` to internal buffer.";
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_7feed(PyObject *__pyx_v_self, PyObject *__pyx_v_next_bytes) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("feed (wrapper)", 0);
__pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_6feed(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), ((PyObject *)__pyx_v_next_bytes));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_6feed(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_next_bytes) {
char *__pyx_v_buf;
Py_ssize_t __pyx_v_buf_len;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("feed", 0);
/* "pandas/msgpack.pyx":525
* init_ctx(&self.ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
*
* def feed(self, object next_bytes): # <<<<<<<<<<<<<<
* """Append `next_bytes` to internal buffer."""
* cdef char* buf
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("pandas.msgpack.Unpacker.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
526: """Append `next_bytes` to internal buffer."""
527: cdef char* buf
528: cdef Py_ssize_t buf_len
529: if self.file_like is not None:
/* "pandas/msgpack.pyx":529
* cdef char* buf
* cdef Py_ssize_t buf_len
* if self.file_like is not None: # <<<<<<<<<<<<<<
* raise TypeError(
* "unpacker.feed() is not be able to use with `file_like`.")
*/
__pyx_t_1 = (__pyx_v_self->file_like != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
530: raise TypeError(
/* "pandas/msgpack.pyx":530
* cdef Py_ssize_t buf_len
* if self.file_like is not None:
* raise TypeError( # <<<<<<<<<<<<<<
* "unpacker.feed() is not be able to use with `file_like`.")
* PyObject_AsReadBuffer(next_bytes, <const_void_ptr*>&buf, &buf_len)
*/
__pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":530
* cdef Py_ssize_t buf_len
* if self.file_like is not None:
* raise TypeError( # <<<<<<<<<<<<<<
* "unpacker.feed() is not be able to use with `file_like`.")
* PyObject_AsReadBuffer(next_bytes, <const_void_ptr*>&buf, &buf_len)
*/
__pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unpacker_feed_is_not_be_able_to); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__19);
__Pyx_GIVEREF(__pyx_tuple__19);
531: "unpacker.feed() is not be able to use with `file_like`.")
532: PyObject_AsReadBuffer(next_bytes, <const_void_ptr*>&buf, &buf_len)
/* "pandas/msgpack.pyx":532 * raise TypeError( * "unpacker.feed() is not be able to use with `file_like`.") * PyObject_AsReadBuffer(next_bytes, <const_void_ptr*>&buf, &buf_len) # <<<<<<<<<<<<<< * self.append_buffer(buf, buf_len) * */ __pyx_t_4 = PyObject_AsReadBuffer(__pyx_v_next_bytes, ((const void* *)(&__pyx_v_buf)), (&__pyx_v_buf_len)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
533: self.append_buffer(buf, buf_len)
/* "pandas/msgpack.pyx":533 * "unpacker.feed() is not be able to use with `file_like`.") * PyObject_AsReadBuffer(next_bytes, <const_void_ptr*>&buf, &buf_len) * self.append_buffer(buf, buf_len) # <<<<<<<<<<<<<< * * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): */ __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->append_buffer(__pyx_v_self, __pyx_v_buf, __pyx_v_buf_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
534:
535: cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len):
/* "pandas/msgpack.pyx":535
* self.append_buffer(buf, buf_len)
*
* cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): # <<<<<<<<<<<<<<
* cdef:
* char* buf = self.buf
*/
static PyObject *__pyx_f_6pandas_7msgpack_8Unpacker_append_buffer(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, void *__pyx_v__buf, Py_ssize_t __pyx_v__buf_len) {
char *__pyx_v_buf;
char *__pyx_v_new_buf;
size_t __pyx_v_head;
size_t __pyx_v_tail;
size_t __pyx_v_buf_size;
size_t __pyx_v_new_size;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("append_buffer", 0);
/* "pandas/msgpack.pyx":535
* self.append_buffer(buf, buf_len)
*
* cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): # <<<<<<<<<<<<<<
* cdef:
* char* buf = self.buf
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pandas.msgpack.Unpacker.append_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
536: cdef:
537: char* buf = self.buf
/* "pandas/msgpack.pyx":537 * cdef append_buffer(self, void* _buf, Py_ssize_t _buf_len): * cdef: * char* buf = self.buf # <<<<<<<<<<<<<< * char* new_buf * size_t head = self.buf_head */ __pyx_t_1 = __pyx_v_self->buf; __pyx_v_buf = __pyx_t_1;
538: char* new_buf
539: size_t head = self.buf_head
/* "pandas/msgpack.pyx":539 * char* buf = self.buf * char* new_buf * size_t head = self.buf_head # <<<<<<<<<<<<<< * size_t tail = self.buf_tail * size_t buf_size = self.buf_size */ __pyx_t_2 = __pyx_v_self->buf_head; __pyx_v_head = __pyx_t_2;
540: size_t tail = self.buf_tail
/* "pandas/msgpack.pyx":540 * char* new_buf * size_t head = self.buf_head * size_t tail = self.buf_tail # <<<<<<<<<<<<<< * size_t buf_size = self.buf_size * size_t new_size */ __pyx_t_2 = __pyx_v_self->buf_tail; __pyx_v_tail = __pyx_t_2;
541: size_t buf_size = self.buf_size
/* "pandas/msgpack.pyx":541 * size_t head = self.buf_head * size_t tail = self.buf_tail * size_t buf_size = self.buf_size # <<<<<<<<<<<<<< * size_t new_size * */ __pyx_t_2 = __pyx_v_self->buf_size; __pyx_v_buf_size = __pyx_t_2;
542: size_t new_size
543:
544: if tail + _buf_len > buf_size:
/* "pandas/msgpack.pyx":544
* size_t new_size
*
* if tail + _buf_len > buf_size: # <<<<<<<<<<<<<<
* if ((tail - head) + _buf_len) <= buf_size:
* # move to front.
*/
__pyx_t_3 = (((__pyx_v_tail + __pyx_v__buf_len) > __pyx_v_buf_size) != 0);
if (__pyx_t_3) {
545: if ((tail - head) + _buf_len) <= buf_size:
/* "pandas/msgpack.pyx":545
*
* if tail + _buf_len > buf_size:
* if ((tail - head) + _buf_len) <= buf_size: # <<<<<<<<<<<<<<
* # move to front.
* memmove(buf, buf + head, tail - head)
*/
__pyx_t_3 = ((((__pyx_v_tail - __pyx_v_head) + __pyx_v__buf_len) <= __pyx_v_buf_size) != 0);
if (__pyx_t_3) {
546: # move to front.
547: memmove(buf, buf + head, tail - head)
/* "pandas/msgpack.pyx":547
* if ((tail - head) + _buf_len) <= buf_size:
* # move to front.
* memmove(buf, buf + head, tail - head) # <<<<<<<<<<<<<<
* tail -= head
* head = 0
*/
memmove(__pyx_v_buf, (__pyx_v_buf + __pyx_v_head), (__pyx_v_tail - __pyx_v_head));
548: tail -= head
/* "pandas/msgpack.pyx":548
* # move to front.
* memmove(buf, buf + head, tail - head)
* tail -= head # <<<<<<<<<<<<<<
* head = 0
* else:
*/
__pyx_v_tail = (__pyx_v_tail - __pyx_v_head);
549: head = 0
/* "pandas/msgpack.pyx":549
* memmove(buf, buf + head, tail - head)
* tail -= head
* head = 0 # <<<<<<<<<<<<<<
* else:
* # expand buffer.
*/
__pyx_v_head = 0;
goto __pyx_L4;
}
/*else*/ {
550: else:
551: # expand buffer.
552: new_size = (tail-head) + _buf_len
/* "pandas/msgpack.pyx":552
* else:
* # expand buffer.
* new_size = (tail-head) + _buf_len # <<<<<<<<<<<<<<
* if new_size > self.max_buffer_size:
* raise BufferFull
*/
__pyx_v_new_size = ((__pyx_v_tail - __pyx_v_head) + __pyx_v__buf_len);
553: if new_size > self.max_buffer_size:
/* "pandas/msgpack.pyx":553
* # expand buffer.
* new_size = (tail-head) + _buf_len
* if new_size > self.max_buffer_size: # <<<<<<<<<<<<<<
* raise BufferFull
* new_size = min(new_size*2, self.max_buffer_size)
*/
__pyx_t_3 = ((__pyx_v_new_size > __pyx_v_self->max_buffer_size) != 0);
if (__pyx_t_3) {
554: raise BufferFull
/* "pandas/msgpack.pyx":554
* new_size = (tail-head) + _buf_len
* if new_size > self.max_buffer_size:
* raise BufferFull # <<<<<<<<<<<<<<
* new_size = min(new_size*2, self.max_buffer_size)
* new_buf = <char*>malloc(new_size)
*/
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferFull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
555: new_size = min(new_size*2, self.max_buffer_size)
/* "pandas/msgpack.pyx":555
* if new_size > self.max_buffer_size:
* raise BufferFull
* new_size = min(new_size*2, self.max_buffer_size) # <<<<<<<<<<<<<<
* new_buf = <char*>malloc(new_size)
* if new_buf == NULL:
*/
__pyx_t_2 = __pyx_v_self->max_buffer_size;
__pyx_t_5 = (__pyx_v_new_size * 2);
if (((__pyx_t_2 < __pyx_t_5) != 0)) {
__pyx_t_6 = __pyx_t_2;
} else {
__pyx_t_6 = __pyx_t_5;
}
__pyx_v_new_size = __pyx_t_6;
556: new_buf = <char*>malloc(new_size)
/* "pandas/msgpack.pyx":556
* raise BufferFull
* new_size = min(new_size*2, self.max_buffer_size)
* new_buf = <char*>malloc(new_size) # <<<<<<<<<<<<<<
* if new_buf == NULL:
* # self.buf still holds old buffer and will be freed during
*/
__pyx_v_new_buf = ((char *)malloc(__pyx_v_new_size));
557: if new_buf == NULL:
/* "pandas/msgpack.pyx":557
* new_size = min(new_size*2, self.max_buffer_size)
* new_buf = <char*>malloc(new_size)
* if new_buf == NULL: # <<<<<<<<<<<<<<
* # self.buf still holds old buffer and will be freed during
* # obj destruction
*/
__pyx_t_3 = ((__pyx_v_new_buf == NULL) != 0);
if (__pyx_t_3) {
558: # self.buf still holds old buffer and will be freed during
559: # obj destruction
560: raise MemoryError("Unable to enlarge internal buffer.")
/* "pandas/msgpack.pyx":560
* # self.buf still holds old buffer and will be freed during
* # obj destruction
* raise MemoryError("Unable to enlarge internal buffer.") # <<<<<<<<<<<<<<
* memcpy(new_buf, buf + head, tail - head)
* free(buf)
*/
__pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/* "pandas/msgpack.pyx":560
* # self.buf still holds old buffer and will be freed during
* # obj destruction
* raise MemoryError("Unable to enlarge internal buffer.") # <<<<<<<<<<<<<<
* memcpy(new_buf, buf + head, tail - head)
* free(buf)
*/
__pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_enlarge_internal_buffe); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__20);
__Pyx_GIVEREF(__pyx_tuple__20);
561: memcpy(new_buf, buf + head, tail - head)
/* "pandas/msgpack.pyx":561
* # obj destruction
* raise MemoryError("Unable to enlarge internal buffer.")
* memcpy(new_buf, buf + head, tail - head) # <<<<<<<<<<<<<<
* free(buf)
*
*/
memcpy(__pyx_v_new_buf, (__pyx_v_buf + __pyx_v_head), (__pyx_v_tail - __pyx_v_head));
562: free(buf)
/* "pandas/msgpack.pyx":562
* raise MemoryError("Unable to enlarge internal buffer.")
* memcpy(new_buf, buf + head, tail - head)
* free(buf) # <<<<<<<<<<<<<<
*
* buf = new_buf
*/
free(__pyx_v_buf);
563:
564: buf = new_buf
/* "pandas/msgpack.pyx":564
* free(buf)
*
* buf = new_buf # <<<<<<<<<<<<<<
* buf_size = new_size
* tail -= head
*/
__pyx_v_buf = __pyx_v_new_buf;
565: buf_size = new_size
/* "pandas/msgpack.pyx":565
*
* buf = new_buf
* buf_size = new_size # <<<<<<<<<<<<<<
* tail -= head
* head = 0
*/
__pyx_v_buf_size = __pyx_v_new_size;
566: tail -= head
/* "pandas/msgpack.pyx":566
* buf = new_buf
* buf_size = new_size
* tail -= head # <<<<<<<<<<<<<<
* head = 0
*
*/
__pyx_v_tail = (__pyx_v_tail - __pyx_v_head);
567: head = 0
/* "pandas/msgpack.pyx":567
* buf_size = new_size
* tail -= head
* head = 0 # <<<<<<<<<<<<<<
*
* memcpy(buf + tail, <char*>(_buf), _buf_len)
*/
__pyx_v_head = 0;
}
__pyx_L4:;
goto __pyx_L3;
}
__pyx_L3:;
568:
569: memcpy(buf + tail, <char*>(_buf), _buf_len)
/* "pandas/msgpack.pyx":569 * head = 0 * * memcpy(buf + tail, <char*>(_buf), _buf_len) # <<<<<<<<<<<<<< * self.buf = buf * self.buf_head = head */ memcpy((__pyx_v_buf + __pyx_v_tail), ((char *)__pyx_v__buf), __pyx_v__buf_len);
570: self.buf = buf
/* "pandas/msgpack.pyx":570 * * memcpy(buf + tail, <char*>(_buf), _buf_len) * self.buf = buf # <<<<<<<<<<<<<< * self.buf_head = head * self.buf_size = buf_size */ __pyx_v_self->buf = __pyx_v_buf;
571: self.buf_head = head
/* "pandas/msgpack.pyx":571 * memcpy(buf + tail, <char*>(_buf), _buf_len) * self.buf = buf * self.buf_head = head # <<<<<<<<<<<<<< * self.buf_size = buf_size * self.buf_tail = tail + _buf_len */ __pyx_v_self->buf_head = __pyx_v_head;
572: self.buf_size = buf_size
/* "pandas/msgpack.pyx":572 * self.buf = buf * self.buf_head = head * self.buf_size = buf_size # <<<<<<<<<<<<<< * self.buf_tail = tail + _buf_len * */ __pyx_v_self->buf_size = __pyx_v_buf_size;
573: self.buf_tail = tail + _buf_len
/* "pandas/msgpack.pyx":573 * self.buf_head = head * self.buf_size = buf_size * self.buf_tail = tail + _buf_len # <<<<<<<<<<<<<< * * cdef read_from_file(self): */ __pyx_v_self->buf_tail = (__pyx_v_tail + __pyx_v__buf_len);
574:
575: cdef read_from_file(self):
/* "pandas/msgpack.pyx":575
* self.buf_tail = tail + _buf_len
*
* cdef read_from_file(self): # <<<<<<<<<<<<<<
* next_bytes = self.file_like_read(
* min(self.read_size,
*/
static PyObject *__pyx_f_6pandas_7msgpack_8Unpacker_read_from_file(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) {
PyObject *__pyx_v_next_bytes = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_from_file", 0);
/* "pandas/msgpack.pyx":575
* self.buf_tail = tail + _buf_len
*
* cdef read_from_file(self): # <<<<<<<<<<<<<<
* next_bytes = self.file_like_read(
* min(self.read_size,
*/
/* 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("pandas.msgpack.Unpacker.read_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_next_bytes);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
576: next_bytes = self.file_like_read(
/* "pandas/msgpack.pyx":576 * * cdef read_from_file(self): * next_bytes = self.file_like_read( # <<<<<<<<<<<<<< * min(self.read_size, * self.max_buffer_size - (self.buf_tail - self.buf_head) */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_v_self->file_like_read, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_next_bytes = __pyx_t_4; __pyx_t_4 = 0;
577: min(self.read_size,
/* "pandas/msgpack.pyx":577 * cdef read_from_file(self): * next_bytes = self.file_like_read( * min(self.read_size, # <<<<<<<<<<<<<< * self.max_buffer_size - (self.buf_tail - self.buf_head) * )) */ __pyx_t_2 = __pyx_v_self->read_size;
578: self.max_buffer_size - (self.buf_tail - self.buf_head)
/* "pandas/msgpack.pyx":578
* next_bytes = self.file_like_read(
* min(self.read_size,
* self.max_buffer_size - (self.buf_tail - self.buf_head) # <<<<<<<<<<<<<<
* ))
* if next_bytes:
*/
__pyx_t_1 = (__pyx_v_self->max_buffer_size - (__pyx_v_self->buf_tail - __pyx_v_self->buf_head));
/* "pandas/msgpack.pyx":578
* next_bytes = self.file_like_read(
* min(self.read_size,
* self.max_buffer_size - (self.buf_tail - self.buf_head) # <<<<<<<<<<<<<<
* ))
* if next_bytes:
*/
if (((__pyx_t_1 < __pyx_t_2) != 0)) {
__pyx_t_3 = __pyx_t_1;
} else {
__pyx_t_3 = __pyx_t_2;
}
__pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
579: ))
580: if next_bytes:
/* "pandas/msgpack.pyx":580 * self.max_buffer_size - (self.buf_tail - self.buf_head) * )) * if next_bytes: # <<<<<<<<<<<<<< * self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes)) * else: */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_next_bytes); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_6) {
581: self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes))
/* "pandas/msgpack.pyx":581
* ))
* if next_bytes:
* self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes)) # <<<<<<<<<<<<<<
* else:
* self.file_like = None
*/
__pyx_t_7 = PyBytes_AsString(__pyx_v_next_bytes); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = PyBytes_Size(__pyx_v_next_bytes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->append_buffer(__pyx_v_self, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L3;
}
/*else*/ {
582: else:
583: self.file_like = None
/* "pandas/msgpack.pyx":583
* self.append_buffer(PyBytes_AsString(next_bytes), PyBytes_Size(next_bytes))
* else:
* self.file_like = None # <<<<<<<<<<<<<<
*
* cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0):
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->file_like);
__Pyx_DECREF(__pyx_v_self->file_like);
__pyx_v_self->file_like = Py_None;
}
__pyx_L3:;
584:
585: cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0):
/* "pandas/msgpack.pyx":585
* self.file_like = None
*
* cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): # <<<<<<<<<<<<<<
* cdef int ret
* cdef object obj
*/
static PyObject *__pyx_f_6pandas_7msgpack_8Unpacker__unpack(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, execute_fn __pyx_v_execute, PyObject *__pyx_v_write_bytes, struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack *__pyx_optional_args) {
int __pyx_v_iter = ((int)0);
int __pyx_v_ret;
PyObject *__pyx_v_obj = 0;
size_t __pyx_v_prev_head;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_unpack", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_iter = __pyx_optional_args->iter;
}
}
/* "pandas/msgpack.pyx":585
* self.file_like = None
*
* cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): # <<<<<<<<<<<<<<
* cdef int ret
* cdef object obj
*/
/* 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_AddTraceback("pandas.msgpack.Unpacker._unpack", __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;
}
/* "pandas/msgpack.pyx":585
* self.file_like = None
*
* cdef object _unpack(self, execute_fn execute, object write_bytes, bint iter=0): # <<<<<<<<<<<<<<
* cdef int ret
* cdef object obj
*/
struct __pyx_opt_args_6pandas_7msgpack_8Unpacker__unpack {
int __pyx_n;
int iter;
};
586: cdef int ret
587: cdef object obj
588: cdef size_t prev_head
589: while 1:
/* "pandas/msgpack.pyx":589
* cdef object obj
* cdef size_t prev_head
* while 1: # <<<<<<<<<<<<<<
* prev_head = self.buf_head
* ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)
*/
while (1) {
590: prev_head = self.buf_head
/* "pandas/msgpack.pyx":590
* cdef size_t prev_head
* while 1:
* prev_head = self.buf_head # <<<<<<<<<<<<<<
* ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)
* if write_bytes is not None:
*/
__pyx_t_1 = __pyx_v_self->buf_head;
__pyx_v_prev_head = __pyx_t_1;
591: ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)
/* "pandas/msgpack.pyx":591
* while 1:
* prev_head = self.buf_head
* ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head) # <<<<<<<<<<<<<<
* if write_bytes is not None:
* write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head))
*/
__pyx_t_2 = __pyx_v_execute((&__pyx_v_self->ctx), __pyx_v_self->buf, __pyx_v_self->buf_tail, (&__pyx_v_self->buf_head)); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_ret = __pyx_t_2;
592: if write_bytes is not None:
/* "pandas/msgpack.pyx":592
* prev_head = self.buf_head
* ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)
* if write_bytes is not None: # <<<<<<<<<<<<<<
* write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head))
*
*/
__pyx_t_3 = (__pyx_v_write_bytes != Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
593: write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head))
/* "pandas/msgpack.pyx":593
* ret = execute(&self.ctx, self.buf, self.buf_tail, &self.buf_head)
* if write_bytes is not None:
* write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head)) # <<<<<<<<<<<<<<
*
* if ret == 1:
*/
__pyx_t_5 = PyBytes_FromStringAndSize((__pyx_v_self->buf + __pyx_v_prev_head), (__pyx_v_self->buf_head - __pyx_v_prev_head)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_v_write_bytes, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L5;
}
__pyx_L5:;
594:
595: if ret == 1:
/* "pandas/msgpack.pyx":595
* write_bytes(PyBytes_FromStringAndSize(self.buf + prev_head, self.buf_head - prev_head))
*
* if ret == 1: # <<<<<<<<<<<<<<
* obj = template_data(&self.ctx)
* template_init(&self.ctx)
*/
case 1:
596: obj = template_data(&self.ctx)
/* "pandas/msgpack.pyx":596
*
* if ret == 1:
* obj = template_data(&self.ctx) # <<<<<<<<<<<<<<
* template_init(&self.ctx)
* return obj
*/
__pyx_t_5 = template_data((&__pyx_v_self->ctx)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_obj = __pyx_t_5;
__pyx_t_5 = 0;
597: template_init(&self.ctx)
/* "pandas/msgpack.pyx":597
* if ret == 1:
* obj = template_data(&self.ctx)
* template_init(&self.ctx) # <<<<<<<<<<<<<<
* return obj
* elif ret == 0:
*/
template_init((&__pyx_v_self->ctx));
598: return obj
/* "pandas/msgpack.pyx":598
* obj = template_data(&self.ctx)
* template_init(&self.ctx)
* return obj # <<<<<<<<<<<<<<
* elif ret == 0:
* if self.file_like is not None:
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_obj);
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
break;
599: elif ret == 0:
/* "pandas/msgpack.pyx":599
* template_init(&self.ctx)
* return obj
* elif ret == 0: # <<<<<<<<<<<<<<
* if self.file_like is not None:
* self.read_from_file()
*/
switch (__pyx_v_ret) {
/* "pandas/msgpack.pyx":599
* template_init(&self.ctx)
* return obj
* elif ret == 0: # <<<<<<<<<<<<<<
* if self.file_like is not None:
* self.read_from_file()
*/
case 0:
600: if self.file_like is not None:
/* "pandas/msgpack.pyx":600
* return obj
* elif ret == 0:
* if self.file_like is not None: # <<<<<<<<<<<<<<
* self.read_from_file()
* continue
*/
__pyx_t_4 = (__pyx_v_self->file_like != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
601: self.read_from_file()
/* "pandas/msgpack.pyx":601
* elif ret == 0:
* if self.file_like is not None:
* self.read_from_file() # <<<<<<<<<<<<<<
* continue
* if iter:
*/
__pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->read_from_file(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
602: continue
/* "pandas/msgpack.pyx":602
* if self.file_like is not None:
* self.read_from_file()
* continue # <<<<<<<<<<<<<<
* if iter:
* raise StopIteration("No more data to unpack.")
*/
goto __pyx_L3_continue;
}
603: if iter:
/* "pandas/msgpack.pyx":603
* self.read_from_file()
* continue
* if iter: # <<<<<<<<<<<<<<
* raise StopIteration("No more data to unpack.")
* else:
*/
__pyx_t_3 = (__pyx_v_iter != 0);
if (__pyx_t_3) {
604: raise StopIteration("No more data to unpack.")
/* "pandas/msgpack.pyx":604
* continue
* if iter:
* raise StopIteration("No more data to unpack.") # <<<<<<<<<<<<<<
* else:
* raise OutOfData("No more data to unpack.")
*/
__pyx_t_5 = PyObject_Call(__pyx_builtin_StopIteration, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
/*else*/ {
/* "pandas/msgpack.pyx":604
* continue
* if iter:
* raise StopIteration("No more data to unpack.") # <<<<<<<<<<<<<<
* else:
* raise OutOfData("No more data to unpack.")
*/
__pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_No_more_data_to_unpack); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__21);
__Pyx_GIVEREF(__pyx_tuple__21);
605: else:
606: raise OutOfData("No more data to unpack.")
/* "pandas/msgpack.pyx":606
* raise StopIteration("No more data to unpack.")
* else:
* raise OutOfData("No more data to unpack.") # <<<<<<<<<<<<<<
* else:
* raise ValueError("Unpack failed: error = %d" % (ret,))
*/
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OutOfData); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
default:
/* "pandas/msgpack.pyx":606
* raise StopIteration("No more data to unpack.")
* else:
* raise OutOfData("No more data to unpack.") # <<<<<<<<<<<<<<
* else:
* raise ValueError("Unpack failed: error = %d" % (ret,))
*/
__pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_more_data_to_unpack); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__22);
__Pyx_GIVEREF(__pyx_tuple__22);
607: else:
608: raise ValueError("Unpack failed: error = %d" % (ret,))
/* "pandas/msgpack.pyx":608
* raise OutOfData("No more data to unpack.")
* else:
* raise ValueError("Unpack failed: error = %d" % (ret,)) # <<<<<<<<<<<<<<
*
* def read_bytes(self, Py_ssize_t nbytes):
*/
__pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Unpack_failed_error_d, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
break;
}
__pyx_L3_continue:;
}
609:
610: def read_bytes(self, Py_ssize_t nbytes):
/* "pandas/msgpack.pyx":610
* raise ValueError("Unpack failed: error = %d" % (ret,))
*
* def read_bytes(self, Py_ssize_t nbytes): # <<<<<<<<<<<<<<
* """read a specified number of raw bytes from the stream"""
* cdef size_t nread
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_9read_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes); /*proto*/
static char __pyx_doc_6pandas_7msgpack_8Unpacker_8read_bytes[] = "Unpacker.read_bytes(self, Py_ssize_t nbytes)\nread a specified number of raw bytes from the stream";
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_9read_bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_nbytes) {
Py_ssize_t __pyx_v_nbytes;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_bytes (wrapper)", 0);
assert(__pyx_arg_nbytes); {
__pyx_v_nbytes = __Pyx_PyIndex_AsSsize_t(__pyx_arg_nbytes); if (unlikely((__pyx_v_nbytes == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.Unpacker.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_8read_bytes(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), ((Py_ssize_t)__pyx_v_nbytes));
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_8read_bytes(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, Py_ssize_t __pyx_v_nbytes) {
size_t __pyx_v_nread;
PyObject *__pyx_v_ret = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_bytes", 0);
/* "pandas/msgpack.pyx":610
* raise ValueError("Unpack failed: error = %d" % (ret,))
*
* def read_bytes(self, Py_ssize_t nbytes): # <<<<<<<<<<<<<<
* """read a specified number of raw bytes from the stream"""
* cdef size_t nread
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("pandas.msgpack.Unpacker.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ret);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
611: """read a specified number of raw bytes from the stream"""
612: cdef size_t nread
613: nread = min(self.buf_tail - self.buf_head, nbytes)
/* "pandas/msgpack.pyx":613
* """read a specified number of raw bytes from the stream"""
* cdef size_t nread
* nread = min(self.buf_tail - self.buf_head, nbytes) # <<<<<<<<<<<<<<
* ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread)
* self.buf_head += nread
*/
__pyx_t_1 = __pyx_v_nbytes;
__pyx_t_2 = (__pyx_v_self->buf_tail - __pyx_v_self->buf_head);
if (((__pyx_t_1 < __pyx_t_2) != 0)) {
__pyx_t_3 = __pyx_t_1;
} else {
__pyx_t_3 = __pyx_t_2;
}
__pyx_v_nread = __pyx_t_3;
614: ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread)
/* "pandas/msgpack.pyx":614 * cdef size_t nread * nread = min(self.buf_tail - self.buf_head, nbytes) * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) # <<<<<<<<<<<<<< * self.buf_head += nread * if len(ret) < nbytes and self.file_like is not None: */ __pyx_t_4 = PyBytes_FromStringAndSize((__pyx_v_self->buf + __pyx_v_self->buf_head), __pyx_v_nread); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_v_ret = __pyx_t_4; __pyx_t_4 = 0;
615: self.buf_head += nread
/* "pandas/msgpack.pyx":615
* nread = min(self.buf_tail - self.buf_head, nbytes)
* ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread)
* self.buf_head += nread # <<<<<<<<<<<<<<
* if len(ret) < nbytes and self.file_like is not None:
* ret += self.file_like.read(nbytes - len(ret))
*/
__pyx_v_self->buf_head = (__pyx_v_self->buf_head + __pyx_v_nread);
616: if len(ret) < nbytes and self.file_like is not None:
/* "pandas/msgpack.pyx":616 * ret = PyBytes_FromStringAndSize(self.buf + self.buf_head, nread) * self.buf_head += nread * if len(ret) < nbytes and self.file_like is not None: # <<<<<<<<<<<<<< * ret += self.file_like.read(nbytes - len(ret)) * return ret */ __pyx_t_1 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((__pyx_t_1 < __pyx_v_nbytes) != 0); if (__pyx_t_5) { __pyx_t_6 = (__pyx_v_self->file_like != Py_None); __pyx_t_7 = (__pyx_t_6 != 0); } else { __pyx_t_7 = __pyx_t_5; } if (__pyx_t_7) {
617: ret += self.file_like.read(nbytes - len(ret))
/* "pandas/msgpack.pyx":617
* self.buf_head += nread
* if len(ret) < nbytes and self.file_like is not None:
* ret += self.file_like.read(nbytes - len(ret)) # <<<<<<<<<<<<<<
* return ret
*
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->file_like, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyObject_Length(__pyx_v_ret); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = PyInt_FromSsize_t((__pyx_v_nbytes - __pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
__pyx_t_8 = PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_ret, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (!(likely(PyBytes_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_9)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF_SET(__pyx_v_ret, ((PyObject*)__pyx_t_9));
__pyx_t_9 = 0;
goto __pyx_L3;
}
__pyx_L3:;
618: return ret
/* "pandas/msgpack.pyx":618 * if len(ret) < nbytes and self.file_like is not None: * ret += self.file_like.read(nbytes - len(ret)) * return ret # <<<<<<<<<<<<<< * * def unpack(self, object write_bytes=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0;
619:
620: def unpack(self, object write_bytes=None):
/* "pandas/msgpack.pyx":620
* return ret
*
* def unpack(self, object write_bytes=None): # <<<<<<<<<<<<<<
* """
* unpack one object
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_7msgpack_8Unpacker_10unpack[] = "Unpacker.unpack(self, write_bytes=None)\n\n unpack one object\n\n If write_bytes is not None, it will be called with parts of the raw\n message as it is unpacked.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n ";
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_write_bytes = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("unpack (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,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);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_write_bytes = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("unpack", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.Unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_10unpack(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_10unpack(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("unpack", 0);
/* "pandas/msgpack.pyx":620
* return ret
*
* def unpack(self, object write_bytes=None): # <<<<<<<<<<<<<<
* """
* unpack one object
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pandas.msgpack.Unpacker.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
621: """
622: unpack one object
623:
624: If write_bytes is not None, it will be called with parts of the raw
625: message as it is unpacked.
626:
627: Raises `OutOfData` when there are no more bytes to unpack.
628: """
629: return self._unpack(template_construct, write_bytes)
/* "pandas/msgpack.pyx":629 * Raises `OutOfData` when there are no more bytes to unpack. * """ * return self._unpack(template_construct, write_bytes) # <<<<<<<<<<<<<< * * def skip(self, object write_bytes=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_construct, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
630:
631: def skip(self, object write_bytes=None):
/* "pandas/msgpack.pyx":631
* return self._unpack(template_construct, write_bytes)
*
* def skip(self, object write_bytes=None): # <<<<<<<<<<<<<<
* """
* read and ignore one object, returning None
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_13skip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_7msgpack_8Unpacker_12skip[] = "Unpacker.skip(self, write_bytes=None)\n\n read and ignore one object, returning None\n\n If write_bytes is not None, it will be called with parts of the raw\n message as it is unpacked.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n ";
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_13skip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_write_bytes = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,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);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "skip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_write_bytes = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("skip", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.Unpacker.skip", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_12skip(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_12skip(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip", 0);
/* "pandas/msgpack.pyx":631
* return self._unpack(template_construct, write_bytes)
*
* def skip(self, object write_bytes=None): # <<<<<<<<<<<<<<
* """
* read and ignore one object, returning None
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pandas.msgpack.Unpacker.skip", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
632: """
633: read and ignore one object, returning None
634:
635: If write_bytes is not None, it will be called with parts of the raw
636: message as it is unpacked.
637:
638: Raises `OutOfData` when there are no more bytes to unpack.
639: """
640: return self._unpack(template_skip, write_bytes)
/* "pandas/msgpack.pyx":640 * Raises `OutOfData` when there are no more bytes to unpack. * """ * return self._unpack(template_skip, write_bytes) # <<<<<<<<<<<<<< * * def read_array_header(self, object write_bytes=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_skip, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
641:
642: def read_array_header(self, object write_bytes=None):
/* "pandas/msgpack.pyx":642
* return self._unpack(template_skip, write_bytes)
*
* def read_array_header(self, object write_bytes=None): # <<<<<<<<<<<<<<
* """assuming the next object is an array, return its size n, such that
* the next n unpack() calls will iterate over its contents.
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_15read_array_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_7msgpack_8Unpacker_14read_array_header[] = "Unpacker.read_array_header(self, write_bytes=None)\nassuming the next object is an array, return its size n, such that\n the next n unpack() calls will iterate over its contents.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n ";
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_15read_array_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_write_bytes = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_array_header (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,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);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes);
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_array_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_write_bytes = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("read_array_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.Unpacker.read_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_14read_array_header(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_14read_array_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_array_header", 0);
/* "pandas/msgpack.pyx":642
* return self._unpack(template_skip, write_bytes)
*
* def read_array_header(self, object write_bytes=None): # <<<<<<<<<<<<<<
* """assuming the next object is an array, return its size n, such that
* the next n unpack() calls will iterate over its contents.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pandas.msgpack.Unpacker.read_array_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
643: """assuming the next object is an array, return its size n, such that
644: the next n unpack() calls will iterate over its contents.
645:
646: Raises `OutOfData` when there are no more bytes to unpack.
647: """
648: return self._unpack(read_array_header, write_bytes)
/* "pandas/msgpack.pyx":648 * Raises `OutOfData` when there are no more bytes to unpack. * """ * return self._unpack(read_array_header, write_bytes) # <<<<<<<<<<<<<< * * def read_map_header(self, object write_bytes=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, read_array_header, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
649:
650: def read_map_header(self, object write_bytes=None):
/* "pandas/msgpack.pyx":650
* return self._unpack(read_array_header, write_bytes)
*
* def read_map_header(self, object write_bytes=None): # <<<<<<<<<<<<<<
* """assuming the next object is a map, return its size n, such that the
* next n * 2 unpack() calls will iterate over its key-value pairs.
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_17read_map_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_7msgpack_8Unpacker_16read_map_header[] = "Unpacker.read_map_header(self, write_bytes=None)\nassuming the next object is a map, return its size n, such that the\n next n * 2 unpack() calls will iterate over its key-value pairs.\n\n Raises `OutOfData` when there are no more bytes to unpack.\n ";
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_17read_map_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_write_bytes = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_map_header (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_write_bytes,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);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_write_bytes);
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_map_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_write_bytes = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("read_map_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("pandas.msgpack.Unpacker.read_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_16read_map_header(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self), __pyx_v_write_bytes);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_16read_map_header(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self, PyObject *__pyx_v_write_bytes) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_map_header", 0);
/* "pandas/msgpack.pyx":650
* return self._unpack(read_array_header, write_bytes)
*
* def read_map_header(self, object write_bytes=None): # <<<<<<<<<<<<<<
* """assuming the next object is a map, return its size n, such that the
* next n * 2 unpack() calls will iterate over its key-value pairs.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pandas.msgpack.Unpacker.read_map_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
651: """assuming the next object is a map, return its size n, such that the
652: next n * 2 unpack() calls will iterate over its key-value pairs.
653:
654: Raises `OutOfData` when there are no more bytes to unpack.
655: """
656: return self._unpack(read_map_header, write_bytes)
/* "pandas/msgpack.pyx":656 * Raises `OutOfData` when there are no more bytes to unpack. * """ * return self._unpack(read_map_header, write_bytes) # <<<<<<<<<<<<<< * * def __iter__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, read_map_header, __pyx_v_write_bytes, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
657:
658: def __iter__(self):
/* "pandas/msgpack.pyx":658
* return self._unpack(read_map_header, write_bytes)
*
* def __iter__(self): # <<<<<<<<<<<<<<
* return self
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_19__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_19__iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
__pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_18__iter__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_18__iter__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__", 0);
/* "pandas/msgpack.pyx":658
* return self._unpack(read_map_header, write_bytes)
*
* def __iter__(self): # <<<<<<<<<<<<<<
* return self
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
659: return self
/* "pandas/msgpack.pyx":659 * * def __iter__(self): * return self # <<<<<<<<<<<<<< * * def __next__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0;
660:
661: def __next__(self):
/* "pandas/msgpack.pyx":661
* return self
*
* def __next__(self): # <<<<<<<<<<<<<<
* return self._unpack(template_construct, None, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_21__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6pandas_7msgpack_8Unpacker_21__next__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
__pyx_r = __pyx_pf_6pandas_7msgpack_8Unpacker_20__next__(((struct __pyx_obj_6pandas_7msgpack_Unpacker *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_6pandas_7msgpack_8Unpacker_20__next__(struct __pyx_obj_6pandas_7msgpack_Unpacker *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__next__", 0);
/* "pandas/msgpack.pyx":661
* return self
*
* def __next__(self): # <<<<<<<<<<<<<<
* return self._unpack(template_construct, None, 1)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pandas.msgpack.Unpacker.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
662: return self._unpack(template_construct, None, 1)
/* "pandas/msgpack.pyx":662 * * def __next__(self): * return self._unpack(template_construct, None, 1) # <<<<<<<<<<<<<< * * # for debug. */ __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.iter = 1; __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_7msgpack_Unpacker *)__pyx_v_self->__pyx_vtab)->_unpack(__pyx_v_self, template_construct, Py_None, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
663:
664: # for debug.
665: #def _buf(self):
666: # return PyString_FromStringAndSize(self.buf, self.buf_tail)
667:
668: #def _off(self):
669: # return self.buf_head