From 3914fd5470d5bd3d85078b5944c0cbf62fa5f117 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Thu, 17 Aug 2023 11:49:56 +0800 Subject: [PATCH 01/31] perf: using cython 1. add taos._cinterface.fetch_all_cython --- build.py | 40 ++++++ pyproject.toml | 6 +- taos/_cinterface.pxd | 45 +++++++ taos/_cinterface.pyx | 304 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 394 insertions(+), 1 deletion(-) create mode 100644 build.py create mode 100644 taos/_cinterface.pxd create mode 100644 taos/_cinterface.pyx diff --git a/build.py b/build.py new file mode 100644 index 00000000..8b236bc0 --- /dev/null +++ b/build.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- +""" +@Project :taos-connector-python +@File :build.py +@Author :hadrianl +@Date :2023/8/10 14:05 +""" + +from Cython.Build import cythonize +from setuptools import Extension +from setuptools.command.build_ext import build_ext +import platform + +compiler_directives = {"language_level": 3, "embedsignature": True} + + +def build(setup_kwargs): + if platform.system() == "Linux": + extensions = [ + Extension("taos._cinterface", ["taos/_cinterface.pyx"], + libraries=["taos"], + ) + ] + elif platform.system() == "Windows": + extensions = [ + Extension("taos._cinterface", ["taos/_cinterface.pyx"], + libraries=["taos"], + include_dirs=[r"C:\TDengine\include"], + library_dirs=[r"C:\TDengine\driver"], + ) + ] + else: + raise Exception("unsupported platform") + + setup_kwargs.update({ + "ext_modules": cythonize(extensions, compiler_directives=compiler_directives, nthreads=5, force=True), + "cmdclass": {"build_ext": build_ext}, + }) + diff --git a/pyproject.toml b/pyproject.toml index b93b9502..94df2101 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,10 @@ packages = [ { include = "taosrest" }, ] +[tool.poetry.build] +generate-setup-file = true +script = "build.py" + [tool.poetry.plugins] # Optional super table [tool.poetry.plugins."sqlalchemy.dialects"] @@ -45,7 +49,7 @@ pandas = { version = ">=1.0", python = ">=3.8,<4.0" } python-dotenv = { version = "0.20.0" } [build-system] -requires = ["poetry-core>=1.0.5"] +requires = ["poetry-core>=1.6.1", "Cython>=3.0.0", "setuptools>=62.0.0"] build-backend = "poetry.core.masonry.api" [tool.black] diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd new file mode 100644 index 00000000..f328f62b --- /dev/null +++ b/taos/_cinterface.pxd @@ -0,0 +1,45 @@ +from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t +from libcpp cimport bool + +cdef extern from "taos.h": + ctypedef void TAOS + ctypedef void TAOS_RES + ctypedef void **TAOS_ROW + ctypedef struct TAOS_FIELD: + char name[65] + int8_t type + int32_t bytes + int TSDB_DATA_TYPE_NULL + int TSDB_DATA_TYPE_BOOL + int TSDB_DATA_TYPE_TINYINT + int TSDB_DATA_TYPE_SMALLINT + int TSDB_DATA_TYPE_INT + int TSDB_DATA_TYPE_BIGINT + int TSDB_DATA_TYPE_FLOAT + int TSDB_DATA_TYPE_DOUBLE + int TSDB_DATA_TYPE_VARCHAR + int TSDB_DATA_TYPE_TIMESTAMP + int TSDB_DATA_TYPE_NCHAR + int TSDB_DATA_TYPE_UTINYINT + int TSDB_DATA_TYPE_USMALLINT + int TSDB_DATA_TYPE_UINT + int TSDB_DATA_TYPE_UBIGINT + int TSDB_DATA_TYPE_JSON + int TSDB_DATA_TYPE_VARBINARY + int TSDB_DATA_TYPE_DECIMAL + int TSDB_DATA_TYPE_BLOB + int TSDB_DATA_TYPE_MEDIUMBLOB + int TSDB_DATA_TYPE_BINARY + int TSDB_DATA_TYPE_GEOMETRY + int TSDB_DATA_TYPE_MAX + int taos_init() + bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col) + TAOS_FIELD *taos_fetch_fields(TAOS_RES *res) + int taos_field_count(TAOS_RES *res) + int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) + int taos_result_precision(TAOS_RES *res) + int *taos_get_column_data_offset(TAOS_RES *res, int columnIndex) + int taos_errno(TAOS_RES *res) + char *taos_errstr(TAOS_RES *res) + TAOS *taos_connect(const char *ip, const char *user, const char *password, const char *db, uint16_t port) + void taos_close(TAOS *taos) \ No newline at end of file diff --git a/taos/_cinterface.pyx b/taos/_cinterface.pyx new file mode 100644 index 00000000..651d2663 --- /dev/null +++ b/taos/_cinterface.pyx @@ -0,0 +1,304 @@ +import datetime as dt +from taos.error import ProgrammingError + +cpdef print_type_size(): + print("bool:", sizeof(bool)) + print("int8_t", sizeof(int8_t)) + print("int16_t", sizeof(int16_t)) + print("int32_t", sizeof(int32_t)) + print("int64_t", sizeof(int64_t)) + print("uint8_t", sizeof(uint8_t)) + print("uint16_t", sizeof(uint16_t)) + print("uint32_t", sizeof(uint32_t)) + print("uint64_t", sizeof(uint64_t)) + print("int", sizeof(int)) + print("uint", sizeof(unsigned int)) + +cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): + cdef list is_null = [] + cdef int i + for i in range(rows): + is_null.append(taos_is_null(res, i, field)) + + return is_null + +cdef list taos_parse_string(size_t ptr, int num_of_rows, int *offsets): + cdef list res = [] + cdef int i + cdef size_t rbyte_ptr + cdef size_t c_char_ptr + for i in range(abs(num_of_rows)): + if offsets[i] == -1: + res.append(None) + else: + rbyte_ptr = ptr + offsets[i] + rbyte = (rbyte_ptr)[0] + c_char_ptr = rbyte_ptr + sizeof(unsigned short) + py_string = (c_char_ptr)[:rbyte].decode("utf-8") + res.append(py_string) + + return res + +cdef list taos_parse_bool(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_int8_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_int16_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_int32_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_int64_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_uint8_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_uint16_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_uint32_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_uint64_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_int(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_uint(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_float(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_double(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list taos_parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + raw_value = v_ptr[i] + if precision <= 1: + _dt = dt_epoch + dt.timedelta(seconds=raw_value / 10**((precision + 1) * 3)) + else: + _dt = raw_value + res.append(_dt) + return res + +cdef taos_fetch_block_v3_cython(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch): + cdef TAOS_ROW pblock + num_of_rows = taos_fetch_block(res, &pblock) + if num_of_rows == 0: + return None, 0 + + precision = taos_result_precision(res) + blocks = [None] * field_count + + cdef int i + for i in range(field_count): + data = pblock[i] + field = fields[i] + + if field.type in (TSDB_DATA_TYPE_VARCHAR, TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_JSON): + offsets = taos_get_column_data_offset(res, i) + blocks[i] = taos_parse_string(data, num_of_rows, offsets) + elif field.type in SIZED_TYPE: + is_null = taos_get_column_data_is_null(res, i, num_of_rows) + blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + is_null = taos_get_column_data_is_null(res, i, num_of_rows) + blocks[i] = taos_parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + else: + pass + + return blocks, abs(num_of_rows) + +cpdef fetch_all_cython(size_t ptr, dt_epoch=None): + res = ptr + fields = taos_fetch_fields(res) + field_count = taos_field_count(res) + + if dt_epoch is None: + dt_epoch = dt.datetime.fromtimestamp(0) + + chunks = [] + cdef int row_count = 0 + while True: + block, num_of_rows = taos_fetch_block_v3_cython(res, fields, field_count, dt_epoch) + errno = taos_errno(res) + + if errno != 0: + raise ProgrammingError(taos_errstr(res), errno) + + if num_of_rows == 0: + break + + row_count += num_of_rows + chunks.append(block) + + return [row for chunk in chunks for row in map(tuple, zip(*chunk))] + +CONVERT_FUNC = { + TSDB_DATA_TYPE_BOOL: taos_parse_bool, + TSDB_DATA_TYPE_TINYINT: taos_parse_int8_t, + TSDB_DATA_TYPE_SMALLINT: taos_parse_int16_t, + TSDB_DATA_TYPE_INT: taos_parse_int, + TSDB_DATA_TYPE_BIGINT: taos_parse_int64_t, + TSDB_DATA_TYPE_FLOAT: taos_parse_float, + TSDB_DATA_TYPE_DOUBLE: taos_parse_double, + TSDB_DATA_TYPE_VARCHAR: None, + TSDB_DATA_TYPE_TIMESTAMP: taos_parse_timestamp, + TSDB_DATA_TYPE_NCHAR: None, + TSDB_DATA_TYPE_UTINYINT: taos_parse_uint8_t, + TSDB_DATA_TYPE_USMALLINT: taos_parse_uint16_t, + TSDB_DATA_TYPE_UINT: taos_parse_uint, + TSDB_DATA_TYPE_UBIGINT: taos_parse_uint64_t, + TSDB_DATA_TYPE_JSON: None, + TSDB_DATA_TYPE_VARBINARY: None, + TSDB_DATA_TYPE_DECIMAL: None, + TSDB_DATA_TYPE_BLOB: None, + TSDB_DATA_TYPE_MEDIUMBLOB: None, + TSDB_DATA_TYPE_BINARY: None, + TSDB_DATA_TYPE_GEOMETRY: None, +} + +SIZED_TYPE = ( + TSDB_DATA_TYPE_BOOL, + TSDB_DATA_TYPE_TINYINT, + TSDB_DATA_TYPE_SMALLINT, + TSDB_DATA_TYPE_INT, + TSDB_DATA_TYPE_BIGINT, + TSDB_DATA_TYPE_FLOAT, + TSDB_DATA_TYPE_DOUBLE, + TSDB_DATA_TYPE_VARCHAR, + TSDB_DATA_TYPE_UTINYINT, + TSDB_DATA_TYPE_USMALLINT, + TSDB_DATA_TYPE_UINT, + TSDB_DATA_TYPE_UBIGINT, +) \ No newline at end of file From b7812325274e54d3bd96ce05cefccc3cebb82cf6 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Thu, 17 Aug 2023 11:52:49 +0800 Subject: [PATCH 02/31] perf: using cython 1. add TaosResult._fetch_all_cython --- taos/result.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/taos/result.py b/taos/result.py index 686358ba..eae16278 100644 --- a/taos/result.py +++ b/taos/result.py @@ -120,6 +120,15 @@ def fetch_all(self): buffer[i].extend(block[i]) return list(map(tuple, zip(*buffer))) + def _fetch_all_using_cython(self): + from taos._cinterface import fetch_all_cython + from taos.field import _datetime_epoch, _priv_datetime_epoch + dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + if self._result is None: + raise OperationalError("Invalid use of fetchall") + + return fetch_all_cython(self._result.value, dt_epoch=dt_epoch) + def fetch_all_into_dict(self): """Fetch all rows and convert it to dict""" names = [field.name for field in self.fields] From 0ba2600cabecba1bea693cb251ecdb932a5e0baf Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Thu, 17 Aug 2023 19:52:30 +0800 Subject: [PATCH 03/31] perf: using cython 1. add TaoConnection and TaosResult --- taos/_cinterface.pxd | 18 ++++- taos/_cinterface.pyx | 178 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 193 insertions(+), 3 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index f328f62b..6ee4408e 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -9,6 +9,14 @@ cdef extern from "taos.h": char name[65] int8_t type int32_t bytes + ctypedef enum TSDB_OPTION: + TSDB_OPTION_LOCALE + TSDB_OPTION_CHARSET + TSDB_OPTION_TIMEZONE + TSDB_OPTION_CONFIGDIR + TSDB_OPTION_SHELL_ACTIVITY_TIMER + TSDB_OPTION_USE_ADAPTER + TSDB_MAX_OPTIONS int TSDB_DATA_TYPE_NULL int TSDB_DATA_TYPE_BOOL int TSDB_DATA_TYPE_TINYINT @@ -42,4 +50,12 @@ cdef extern from "taos.h": int taos_errno(TAOS_RES *res) char *taos_errstr(TAOS_RES *res) TAOS *taos_connect(const char *ip, const char *user, const char *password, const char *db, uint16_t port) - void taos_close(TAOS *taos) \ No newline at end of file + void taos_close(TAOS *taos) + int taos_options(TSDB_OPTION option, const void *arg, ...) + const char *taos_get_client_info() + const char *taos_get_server_info(TAOS *taos) + int taos_select_db(TAOS *taos, const char *db) + TAOS_RES *taos_query(TAOS *taos, const char *sql) + TAOS_RES *taos_query_with_reqid(TAOS *taos, const char *sql, int64_t reqId) + int taos_affected_rows(TAOS_RES *res) + void taos_free_result(TAOS_RES *res) \ No newline at end of file diff --git a/taos/_cinterface.pyx b/taos/_cinterface.pyx index 651d2663..45030465 100644 --- a/taos/_cinterface.pyx +++ b/taos/_cinterface.pyx @@ -1,5 +1,6 @@ import datetime as dt -from taos.error import ProgrammingError +from taos.error import ProgrammingError, OperationalError +from taos._cinterface cimport * cpdef print_type_size(): print("bool:", sizeof(bool)) @@ -301,4 +302,177 @@ SIZED_TYPE = ( TSDB_DATA_TYPE_USMALLINT, TSDB_DATA_TYPE_UINT, TSDB_DATA_TYPE_UBIGINT, -) \ No newline at end of file +) + + +cdef class TaosConnection: + cdef char *_host + cdef char *_user + cdef char *_password + cdef char *_database + cdef uint16_t _port + cdef char *_tz + cdef char *_config + cdef TAOS *_raw_conn + + def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, tz=None, config=None): + host = host.encode("utf-8") if host else None + user = user.encode("utf-8") if user else None + password = password.encode("utf-8") if password else None + database =database.encode("utf-8") if database else None + port = port if port else 0 + tz = tz.encode("utf-8") if tz else None + config = config.encode("utf-8") if tz else None + + self._host = host + self._user = user + self._password = password + self._database = database + self._port = port + self._tz = tz + self._config = config + self._init_options() + self._init_conn() + self._check_err() + + def _init_options(self): + if self._tz: + print("SET TZ:", self._tz) + taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) + + if self._config: + print("SET CONFIGDIR:", self._config) + taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + + def _init_conn(self): + print(self._host, self._user, self._password, self._database, self._port) + self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + + def _check_err(self): + if taos_errno(self._raw_conn) != 0: + errstr = taos_errstr(self._raw_conn) + print("ERROR:", errstr) + + def __dealloc__(self): + self.close() + + def close(self): + if self._raw_conn is not NULL: + taos_close(self._raw_conn) + self._raw_conn = NULL + + @property + def client_info(self): + return (taos_get_client_info()).decode("utf-8") + + @property + def server_info(self): + # type: () -> str + if self._raw_conn is NULL: + return + return (taos_get_server_info(self._raw_conn)).decode("utf-8") + + cpdef select_db(self, char *database): + # type: (str) -> None + taos_select_db(self._raw_conn, database) + + cpdef query(self, str sql, req_id = None): + sql_chars = sql.encode("utf-8") + if req_id is None: + res = taos_query(self._raw_conn, sql_chars) + else: + res = taos_query_with_reqid(self._raw_conn, sql_chars, req_id) + + return TaosResult(res) + + +cdef class TaosResult: + cdef TAOS_RES *_res + cdef TAOS_FIELD *_fields + cdef int _field_count + cdef int _precision + cdef int _row_count + + def __cinit__(self, size_t res): + self._res = res + self._fields = taos_fetch_fields(self._res) + self._field_count = taos_field_count(self._res) + self._precision = taos_result_precision(self._res) + self._row_count = 0 + + @property + def field_count(self): + return self._field_count + + @property + def precision(self): + return self._precision + + @property + def affected_rows(self): + return taos_affected_rows(self._res) + + @property + def row_count(self): + return self._row_count + + def _fetch_block(self): + cdef TAOS_ROW pblock + num_of_rows = taos_fetch_block(self._res, &pblock) + if num_of_rows == 0: + return [], 0 + + blocks = [None] * self._field_count + dt_epoch = dt.datetime.fromtimestamp(0) + cdef int i + for i in range(self._field_count): + data = pblock[i] + field = self._fields[i] + + if field.type in (TSDB_DATA_TYPE_VARCHAR, TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_JSON): + offsets = taos_get_column_data_offset(self._res, i) + blocks[i] = taos_parse_string(data, num_of_rows, offsets) + elif field.type in SIZED_TYPE: + is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + blocks[i] = taos_parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) + else: + pass + + return blocks, abs(num_of_rows) + + cpdef fetch_block(self): + if self._res is NULL: + raise OperationalError("Invalid use of fetch iterator") + + return self._fetch_block() + + cpdef fetch_all(self): + if self._res is NULL: + raise OperationalError("Invalid use of fetchall") + + blocks = [] + self._row_count = 0 + while True: + block, num_of_rows = self._fetch_block() + + errno = taos_errno(self._res) + if errno != 0: + raise ProgrammingError(taos_errstr(self._res), errno) + + if num_of_rows == 0: + break + + self._row_count += num_of_rows + blocks.append(block) + + return [r for b in blocks for r in map(tuple, zip(*b))] + + def __dealloc__(self): + if self._res is not NULL: + taos_free_result(self._res) + + self._res = NULL + self._fields = NULL From 40e9cc33d8ba0b015c4f32643a7a30f12e4681d2 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Mon, 21 Aug 2023 18:09:41 +0800 Subject: [PATCH 04/31] perf: using cython 1. add TaosField 2. serval more methods 3. typo --- taos/_cinterface.pxd | 32 ++- taos/_cinterface.pyx | 557 ++++++++++++++++++++++++++++++++++--------- taos/result.py | 4 +- 3 files changed, 476 insertions(+), 117 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 6ee4408e..5ede59da 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -1,8 +1,9 @@ -from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t +from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t from libcpp cimport bool cdef extern from "taos.h": ctypedef void TAOS + ctypedef void TAOS_STMT ctypedef void TAOS_RES ctypedef void **TAOS_ROW ctypedef struct TAOS_FIELD: @@ -17,6 +18,15 @@ cdef extern from "taos.h": TSDB_OPTION_SHELL_ACTIVITY_TIMER TSDB_OPTION_USE_ADAPTER TSDB_MAX_OPTIONS + ctypedef struct TAOS_MULTI_BIND: + int buffer_type + void *buffer + uintptr_t buffer_length + int32_t *length + char *is_null + int num + + ctypedef void (*__taos_async_fn_t)(void *param, TAOS_RES *res, int num_of_rows) except * int TSDB_DATA_TYPE_NULL int TSDB_DATA_TYPE_BOOL int TSDB_DATA_TYPE_TINYINT @@ -58,4 +68,22 @@ cdef extern from "taos.h": TAOS_RES *taos_query(TAOS *taos, const char *sql) TAOS_RES *taos_query_with_reqid(TAOS *taos, const char *sql, int64_t reqId) int taos_affected_rows(TAOS_RES *res) - void taos_free_result(TAOS_RES *res) \ No newline at end of file + void taos_free_result(TAOS_RES *res) + TAOS_ROW taos_fetch_row(TAOS_RES *res) + void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) + void taos_query_a(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param) + void taos_query_a_with_reqid(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param, int64_t reqid) + void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) + const void *taos_get_raw_block(TAOS_RES *res) + TAOS_STMT *taos_stmt_init(TAOS *taos) + int taos_stmt_prepare(TAOS_STMT *stmt, const char *sql, unsigned long length) + int taos_stmt_set_tbname(TAOS_STMT *stmt, const char *name) + int taos_stmt_set_tbname_tags(TAOS_STMT *stmt, const char *name, TAOS_MULTI_BIND *tags) + int taos_stmt_affected_rows(TAOS_STMT *stmt) + TAOS_RES *taos_stmt_use_result(TAOS_STMT *stmt) + int taos_stmt_execute(TAOS_STMT *stmt) + int taos_stmt_add_batch(TAOS_STMT *stmt) + int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) + int taos_stmt_bind_param_batch(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) + int taos_get_table_vgId(TAOS *taos, const char *db, const char *table, int *vgId) + int taos_load_table_info(TAOS *taos, const char *tableNameList) \ No newline at end of file diff --git a/taos/_cinterface.pyx b/taos/_cinterface.pyx index 45030465..22bbebae 100644 --- a/taos/_cinterface.pyx +++ b/taos/_cinterface.pyx @@ -1,7 +1,27 @@ +# cython: profile=True + +import cython import datetime as dt -from taos.error import ProgrammingError, OperationalError +import pytz +from collections import namedtuple +from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError from taos._cinterface cimport * +_priv_tz = None +_utc_tz = pytz.timezone("UTC") +try: + _datetime_epoch = dt.datetime.fromtimestamp(0) +except OSError: + _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) +_utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) +_priv_datetime_epoch = None + + +def set_tz(tz): + global _priv_tz, _priv_datetime_epoch + _priv_tz = tz + _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) + cpdef print_type_size(): print("bool:", sizeof(bool)) print("int8_t", sizeof(int8_t)) @@ -17,13 +37,52 @@ cpdef print_type_size(): cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): cdef list is_null = [] - cdef int i - for i in range(rows): - is_null.append(taos_is_null(res, i, field)) + cdef int r + for r in range(rows): + is_null.append(taos_is_null(res, r, field)) return is_null -cdef list taos_parse_string(size_t ptr, int num_of_rows, int *offsets): +cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: + with gil: + callback = param + print("callback:", callback, res, code) + dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + fields = taos_fetch_fields(res) + field_count = taos_field_count(res) + taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] + block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) + errno = taos_errno(res) + + if errno != 0: + raise ProgrammingError(taos_errstr(res), errno) + + for row in map(tuple, zip(*block)): + callback(row, taos_fields) + + +# --------------------------------------------- parser ---------------------------------------------------------------v +cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): + cdef list res = [] + cdef int i + for i in range(abs(num_of_rows)): + nchar_ptr = ptr + field_length * i + py_string = (nchar_ptr).decode("utf-8") + res.append(py_string) + + return res + +cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): + cdef list res = [] + cdef int i + for i in range(abs(num_of_rows)): + c_char_ptr = ptr + field_length * i + py_string = (c_char_ptr)[:field_length].decode("utf-8") + res.append(py_string) + + return res + +cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): cdef list res = [] cdef int i cdef size_t rbyte_ptr @@ -40,7 +99,7 @@ cdef list taos_parse_string(size_t ptr, int num_of_rows, int *offsets): return res -cdef list taos_parse_bool(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -52,7 +111,7 @@ cdef list taos_parse_bool(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_int8_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -64,7 +123,7 @@ cdef list taos_parse_int8_t(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_int16_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -76,7 +135,7 @@ cdef list taos_parse_int16_t(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_int32_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -88,7 +147,7 @@ cdef list taos_parse_int32_t(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_int64_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -100,7 +159,7 @@ cdef list taos_parse_int64_t(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_uint8_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -112,7 +171,7 @@ cdef list taos_parse_uint8_t(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_uint16_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -124,7 +183,7 @@ cdef list taos_parse_uint16_t(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_uint32_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -136,7 +195,7 @@ cdef list taos_parse_uint32_t(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_uint64_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -148,7 +207,7 @@ cdef list taos_parse_uint64_t(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_int(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -160,7 +219,7 @@ cdef list taos_parse_int(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_uint(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -172,7 +231,7 @@ cdef list taos_parse_uint(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_float(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -184,7 +243,7 @@ cdef list taos_parse_float(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_double(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): cdef list res = [] cdef int i v_ptr = ptr @@ -196,9 +255,10 @@ cdef list taos_parse_double(size_t ptr, int num_of_rows, list is_null): return res -cdef list taos_parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): +cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): cdef list res = [] cdef int i + cdef double denom = 10**((precision + 1) * 3) v_ptr = ptr for i in range(abs(num_of_rows)): if is_null[i]: @@ -206,17 +266,66 @@ cdef list taos_parse_timestamp(size_t ptr, int num_of_rows, list is_null, int pr else: raw_value = v_ptr[i] if precision <= 1: - _dt = dt_epoch + dt.timedelta(seconds=raw_value / 10**((precision + 1) * 3)) + _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) else: _dt = raw_value res.append(_dt) return res -cdef taos_fetch_block_v3_cython(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch): +# --------------------------------------------- parser ---------------------------------------------------------------^ +SIZED_TYPE = { + TSDB_DATA_TYPE_BOOL, + TSDB_DATA_TYPE_TINYINT, + TSDB_DATA_TYPE_SMALLINT, + TSDB_DATA_TYPE_INT, + TSDB_DATA_TYPE_BIGINT, + TSDB_DATA_TYPE_FLOAT, + TSDB_DATA_TYPE_DOUBLE, + TSDB_DATA_TYPE_VARCHAR, + TSDB_DATA_TYPE_UTINYINT, + TSDB_DATA_TYPE_USMALLINT, + TSDB_DATA_TYPE_UINT, + TSDB_DATA_TYPE_UBIGINT, +} + +UNSIZED_TYPE = { + TSDB_DATA_TYPE_VARCHAR, + TSDB_DATA_TYPE_NCHAR, + TSDB_DATA_TYPE_JSON, + TSDB_DATA_TYPE_VARBINARY, + TSDB_DATA_TYPE_BINARY, +} + +CONVERT_FUNC = { + TSDB_DATA_TYPE_BOOL: _parse_bool, + TSDB_DATA_TYPE_TINYINT: _parse_int8_t, + TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, + TSDB_DATA_TYPE_INT: _parse_int, + TSDB_DATA_TYPE_BIGINT: _parse_int64_t, + TSDB_DATA_TYPE_FLOAT: _parse_float, + TSDB_DATA_TYPE_DOUBLE: _parse_double, + TSDB_DATA_TYPE_VARCHAR: None, + TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, + TSDB_DATA_TYPE_NCHAR: None, + TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, + TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, + TSDB_DATA_TYPE_UINT: _parse_uint, + TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, + TSDB_DATA_TYPE_JSON: None, + TSDB_DATA_TYPE_VARBINARY: None, + TSDB_DATA_TYPE_DECIMAL: None, + TSDB_DATA_TYPE_BLOB: None, + TSDB_DATA_TYPE_MEDIUMBLOB: None, + TSDB_DATA_TYPE_BINARY: None, + TSDB_DATA_TYPE_GEOMETRY: None, +} + + +cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch): cdef TAOS_ROW pblock num_of_rows = taos_fetch_block(res, &pblock) if num_of_rows == 0: - return None, 0 + return [], 0 precision = taos_result_precision(res) blocks = [None] * field_count @@ -226,32 +335,29 @@ cdef taos_fetch_block_v3_cython(TAOS_RES *res, TAOS_FIELD *fields, int field_cou data = pblock[i] field = fields[i] - if field.type in (TSDB_DATA_TYPE_VARCHAR, TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_JSON): + if field.type in UNSIZED_TYPE: offsets = taos_get_column_data_offset(res, i) - blocks[i] = taos_parse_string(data, num_of_rows, offsets) + blocks[i] = _parse_string(data, num_of_rows, offsets) elif field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(res, i, num_of_rows) blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): is_null = taos_get_column_data_is_null(res, i, num_of_rows) - blocks[i] = taos_parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) else: pass return blocks, abs(num_of_rows) -cpdef fetch_all_cython(size_t ptr, dt_epoch=None): +cpdef fetch_all(size_t ptr, dt_epoch): res = ptr fields = taos_fetch_fields(res) field_count = taos_field_count(res) - if dt_epoch is None: - dt_epoch = dt.datetime.fromtimestamp(0) - chunks = [] cdef int row_count = 0 while True: - block, num_of_rows = taos_fetch_block_v3_cython(res, fields, field_count, dt_epoch) + block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) errno = taos_errno(res) if errno != 0: @@ -265,45 +371,6 @@ cpdef fetch_all_cython(size_t ptr, dt_epoch=None): return [row for chunk in chunks for row in map(tuple, zip(*chunk))] -CONVERT_FUNC = { - TSDB_DATA_TYPE_BOOL: taos_parse_bool, - TSDB_DATA_TYPE_TINYINT: taos_parse_int8_t, - TSDB_DATA_TYPE_SMALLINT: taos_parse_int16_t, - TSDB_DATA_TYPE_INT: taos_parse_int, - TSDB_DATA_TYPE_BIGINT: taos_parse_int64_t, - TSDB_DATA_TYPE_FLOAT: taos_parse_float, - TSDB_DATA_TYPE_DOUBLE: taos_parse_double, - TSDB_DATA_TYPE_VARCHAR: None, - TSDB_DATA_TYPE_TIMESTAMP: taos_parse_timestamp, - TSDB_DATA_TYPE_NCHAR: None, - TSDB_DATA_TYPE_UTINYINT: taos_parse_uint8_t, - TSDB_DATA_TYPE_USMALLINT: taos_parse_uint16_t, - TSDB_DATA_TYPE_UINT: taos_parse_uint, - TSDB_DATA_TYPE_UBIGINT: taos_parse_uint64_t, - TSDB_DATA_TYPE_JSON: None, - TSDB_DATA_TYPE_VARBINARY: None, - TSDB_DATA_TYPE_DECIMAL: None, - TSDB_DATA_TYPE_BLOB: None, - TSDB_DATA_TYPE_MEDIUMBLOB: None, - TSDB_DATA_TYPE_BINARY: None, - TSDB_DATA_TYPE_GEOMETRY: None, -} - -SIZED_TYPE = ( - TSDB_DATA_TYPE_BOOL, - TSDB_DATA_TYPE_TINYINT, - TSDB_DATA_TYPE_SMALLINT, - TSDB_DATA_TYPE_INT, - TSDB_DATA_TYPE_BIGINT, - TSDB_DATA_TYPE_FLOAT, - TSDB_DATA_TYPE_DOUBLE, - TSDB_DATA_TYPE_VARCHAR, - TSDB_DATA_TYPE_UTINYINT, - TSDB_DATA_TYPE_USMALLINT, - TSDB_DATA_TYPE_UINT, - TSDB_DATA_TYPE_UBIGINT, -) - cdef class TaosConnection: cdef char *_host @@ -315,43 +382,55 @@ cdef class TaosConnection: cdef char *_config cdef TAOS *_raw_conn - def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, tz=None, config=None): - host = host.encode("utf-8") if host else None - user = user.encode("utf-8") if user else None - password = password.encode("utf-8") if password else None - database =database.encode("utf-8") if database else None - port = port if port else 0 - tz = tz.encode("utf-8") if tz else None - config = config.encode("utf-8") if tz else None - - self._host = host - self._user = user - self._password = password - self._database = database - self._port = port - self._tz = tz - self._config = config + def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): + if host: + host = host.encode("utf-8") + self._host = host + + if user: + user = user.encode("utf-8") + self._user = user + + if password: + password = password.encode("utf-8") + self._password = password + + if database: + database =database.encode("utf-8") + self._database = database + + if port: + self._port = port + + if timezone: + timezone = timezone.encode("utf-8") + self._tz = timezone + + if config: + config = config.encode("utf-8") + self._config = config + self._init_options() self._init_conn() - self._check_err() + self._check_conn_error() def _init_options(self): if self._tz: - print("SET TZ:", self._tz) + tz = self._tz + set_tz(pytz.timezone(tz.decode("utf-8"))) taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) if self._config: - print("SET CONFIGDIR:", self._config) taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) def _init_conn(self): - print(self._host, self._user, self._password, self._database, self._port) self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - def _check_err(self): - if taos_errno(self._raw_conn) != 0: + def _check_conn_error(self): + errno = taos_errno(self._raw_conn) + if errno != 0: errstr = taos_errstr(self._raw_conn) - print("ERROR:", errstr) + raise ConnectionError(errstr, errno) def __dealloc__(self): self.close() @@ -372,19 +451,99 @@ cdef class TaosConnection: return return (taos_get_server_info(self._raw_conn)).decode("utf-8") - cpdef select_db(self, char *database): - # type: (str) -> None - taos_select_db(self._raw_conn, database) + def select_db(self, database: str): + _database = database.encode("utf-8") + res = taos_select_db(self._raw_conn, _database) + if res != 0: + raise DatabaseError("select database error", res) - cpdef query(self, str sql, req_id = None): - sql_chars = sql.encode("utf-8") + def execute(self, sql: str, req_id: Optional[int] = None): + return self.query(sql, req_id).affected_rows + + def query(self, sql: str, req_id: Optional[int] = None): + _sql = sql.encode("utf-8") if req_id is None: - res = taos_query(self._raw_conn, sql_chars) + res = taos_query(self._raw_conn, _sql) else: - res = taos_query_with_reqid(self._raw_conn, sql_chars, req_id) + res = taos_query_with_reqid(self._raw_conn, _sql, req_id) return TaosResult(res) + def query_a(self, sql: str, callback, req_id: Optional[int] = None): + _sql = sql.encode("utf-8") + if req_id is None: + taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) + else: + taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + + def load_table_info(self, tables: list): + # type: (str) -> None + _tables = ",".join(tables).encode("utf-8") + taos_load_table_info(self._raw_conn, _tables) + + def commit(self): + """Commit any pending transaction to the database. + + Since TDengine do not support transactions, the implement is void functionality. + """ + pass + + def rollback(self): + """Void functionality""" + pass + + def clear_result_set(self): + """Clear unused result set on this connection.""" + pass + + def get_table_vgroup_id(self, db: str, table: str): + # type: (str, str) -> int + """ + get table's vgroup id. It's require db name and table name, and return an int type vgroup id. + """ + cdef int vg_id + _db = db.encode("utf-8") + _table = table.encode("utf-8") + code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) + if code != 0: + raise InternalError(taos_errstr(NULL)) + return vg_id + +cdef class TaosField: + cdef str _name + cdef int8_t _type + cdef int32_t _bytes + + def __cinit__(self, str name, int8_t type_, int32_t bytes): + self._name = name + self._type = type_ + self._bytes = bytes + + @property + def name(self): + return self._name + + @property + def type(self): + return self._type + + @property + def bytes(self): + return self._bytes + + @property + def length(self): + return self._bytes + + def __str__(self): + return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + + def __repr__(self): + return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + + def __getitem__(self, item): + return getattr(self, item) + cdef class TaosResult: cdef TAOS_RES *_res @@ -392,14 +551,30 @@ cdef class TaosResult: cdef int _field_count cdef int _precision cdef int _row_count + cdef int _affected_rows def __cinit__(self, size_t res): self._res = res - self._fields = taos_fetch_fields(self._res) + self._check_result_error() self._field_count = taos_field_count(self._res) + self._fields = taos_fetch_fields(self._res) self._precision = taos_result_precision(self._res) + self._affected_rows = taos_affected_rows(self._res) self._row_count = 0 + def __str__(self): + return "TaosResult{res: %s}" % (self._res, ) + + def __repr__(self): + return "TaosResult{res: %s}" % (self._res, ) + + def __iter__(self): + return self.rows_iter() + + @property + def fields(self): + return [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] + @property def field_count(self): return self._field_count @@ -410,12 +585,18 @@ cdef class TaosResult: @property def affected_rows(self): - return taos_affected_rows(self._res) + return self._affected_rows @property def row_count(self): return self._row_count + def _check_result_error(self): + errno = taos_errno(self._res) + if errno != 0: + errstr = taos_errstr(self._res) + raise ProgrammingError(errstr, errno) + def _fetch_block(self): cdef TAOS_ROW pblock num_of_rows = taos_fetch_block(self._res, &pblock) @@ -423,44 +604,43 @@ cdef class TaosResult: return [], 0 blocks = [None] * self._field_count - dt_epoch = dt.datetime.fromtimestamp(0) + dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch cdef int i for i in range(self._field_count): data = pblock[i] field = self._fields[i] - if field.type in (TSDB_DATA_TYPE_VARCHAR, TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_JSON): + if field.type in UNSIZED_TYPE: offsets = taos_get_column_data_offset(self._res, i) - blocks[i] = taos_parse_string(data, num_of_rows, offsets) + blocks[i] = _parse_string(data, num_of_rows, offsets) elif field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - blocks[i] = taos_parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) + blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) else: pass return blocks, abs(num_of_rows) - cpdef fetch_block(self): + def fetch_block(self): if self._res is NULL: raise OperationalError("Invalid use of fetch iterator") - return self._fetch_block() + block, num_of_rows = self._fetch_block() + self._row_count += num_of_rows - cpdef fetch_all(self): + return [r for r in map(tuple, zip(*block))], num_of_rows + + def fetch_all(self): if self._res is NULL: raise OperationalError("Invalid use of fetchall") blocks = [] - self._row_count = 0 while True: block, num_of_rows = self._fetch_block() - - errno = taos_errno(self._res) - if errno != 0: - raise ProgrammingError(taos_errstr(self._res), errno) + self._check_result_error() if num_of_rows == 0: break @@ -470,9 +650,160 @@ cdef class TaosResult: return [r for b in blocks for r in map(tuple, zip(*b))] + def fetch_all_into_dict(self): + if self._res is NULL: + raise OperationalError("Invalid use of fetchall") + + field_names = [field.name for field in self.fields] + dict_row_cls = namedtuple('DictRow', field_names) + blocks = [] + while True: + block, num_of_rows = self._fetch_block() + self._check_result_error() + + if num_of_rows == 0: + break + + self._row_count += num_of_rows + blocks.append(block) + + return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] + + def rows_iter(self): + if self._res is NULL: + raise OperationalError("Invalid use of rows_iter") + + cdef TAOS_ROW taos_row + cdef int i + dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + is_null = [False] + + while True: + taos_row = taos_fetch_row(self._res) + if taos_row is NULL: + break + + row = [None] * self._field_count + for i in range(self._field_count): + data = taos_row[i] + field = self._fields[i] + if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): + row[i] = _parse_binary_string(data, 1, field.bytes)[0] + elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): + row[i] = _parse_nchar_string(data, 1, field.bytes)[0] + elif field.type in SIZED_TYPE: + row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] + elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] + else: + pass + + self._row_count += 1 + yield row + + def blocks_iter(self): + if self._res is NULL: + raise OperationalError("Invalid use of rows_iter") + + while True: + block, num_of_rows = self._fetch_block() + + if num_of_rows == 0: + break + + yield [r for r in map(tuple, zip(*block))], num_of_rows + + def fetch_rows_a(self, callback): + taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + + def taos_fetch_raw_block_a(self, callback): + taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) + def __dealloc__(self): if self._res is not NULL: taos_free_result(self._res) self._res = NULL self._fields = NULL + + + + +# class TaosStmt(object): +# cdef TAOS_STMT *_stmt +# +# def __cinit__(self, size_t stmt): +# self._stmt = stmt +# +# def set_tbname(self, name: str): +# if self._stmt is NULL: +# raise StatementError("Invalid use of set_tbname") +# +# _name = name.decode("utf-8") +# taos_stmt_set_tbname(self._stmt, _name) +# +# def prepare(self, sql: str): +# _sql = sql.decode("utf-8") +# taos_stmt_prepare(self._stmt, _sql, len(_sql)) +# +# def set_tbname_tags(self, name: str, tags: list): +# # type: (str, Array[TaosBind]) -> None +# """Set table name with tags, tags is array of BindParams""" +# if self._stmt is NULL: +# raise StatementError("Invalid use of set_tbname_tags") +# taos_stmt_set_tbname_tags(self._stmt, name, NULL) +# +# def bind_param(self, params, add_batch=True): +# # type: (Array[TaosBind], bool) -> None +# if self._stmt is None: +# raise StatementError("Invalid use of stmt") +# taos_stmt_bind_param(self._stmt, params) +# if add_batch: +# taos_stmt_add_batch(self._stmt) +# +# def bind_param_batch(self, binds, add_batch=True): +# # type: (Array[TaosMultiBind], bool) -> None +# if self._stmt is NULL: +# raise StatementError("Invalid use of stmt") +# taos_stmt_bind_param_batch(self._stmt, binds) +# if add_batch: +# taos_stmt_add_batch(self._stmt) +# +# def add_batch(self): +# if self._stmt is NULL: +# raise StatementError("Invalid use of stmt") +# taos_stmt_add_batch(self._stmt) +# +# def execute(self): +# if self._stmt is NULL: +# raise StatementError("Invalid use of execute") +# taos_stmt_execute(self._stmt) +# +# def use_result(self): +# """NOTE: Don't use a stmt result more than once.""" +# result = taos_stmt_use_result(self._stmt) +# return TaosResult(result) +# +# @property +# def affected_rows(self): +# # type: () -> int +# return taos_stmt_affected_rows(self._stmt) +# +# def close(self): +# """Close stmt.""" +# if self._stmt is NULL: +# return +# taos_stmt_close(self._stmt) +# self._stmt = NULL +# +# def __dealloc__(self): +# self.close() +# +# +# class TaosMultiBind: +# cdef int buffer_type +# cdef void *buffer +# cdef uintptr_t buffer_length +# cdef int32_t *length +# cdef char *is_null +# cdef int num diff --git a/taos/result.py b/taos/result.py index eae16278..f7990717 100644 --- a/taos/result.py +++ b/taos/result.py @@ -121,13 +121,13 @@ def fetch_all(self): return list(map(tuple, zip(*buffer))) def _fetch_all_using_cython(self): - from taos._cinterface import fetch_all_cython + from taos._cinterface import fetch_all as _fetch_all from taos.field import _datetime_epoch, _priv_datetime_epoch dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch if self._result is None: raise OperationalError("Invalid use of fetchall") - return fetch_all_cython(self._result.value, dt_epoch=dt_epoch) + return _fetch_all(self._result.value, dt_epoch) def fetch_all_into_dict(self): """Fetch all rows and convert it to dict""" From d1c8db71e4dd61d5b2c73c19958f7dfa0d89e2a2 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Tue, 22 Aug 2023 11:42:04 +0800 Subject: [PATCH 05/31] perf: using cython 1. _cinterface split into _cinterface, _objects, _parser --- build.py | 20 +- taos/_cinterface.pxd | 5 +- taos/_cinterface.pyx | 679 +------------------------------------------ taos/_objects.pyx | 476 ++++++++++++++++++++++++++++++ taos/_parser.pxd | 36 +++ taos/_parser.pyx | 211 ++++++++++++++ 6 files changed, 745 insertions(+), 682 deletions(-) create mode 100644 taos/_objects.pyx create mode 100644 taos/_parser.pxd create mode 100644 taos/_parser.pyx diff --git a/build.py b/build.py index 8b236bc0..bcff52f5 100644 --- a/build.py +++ b/build.py @@ -7,9 +7,9 @@ @Date :2023/8/10 14:05 """ -from Cython.Build import cythonize +from Cython.Build import cythonize, build_ext from setuptools import Extension -from setuptools.command.build_ext import build_ext +# from setuptools.command.build_ext import build_ext import platform compiler_directives = {"language_level": 3, "embedsignature": True} @@ -20,7 +20,11 @@ def build(setup_kwargs): extensions = [ Extension("taos._cinterface", ["taos/_cinterface.pyx"], libraries=["taos"], - ) + ), + Extension("taos._parser", ["taos/_parser.pyx"], language="c++"), + Extension("taos._objects", ["taos/_objects.pyx"], + libraries=["taos"], + ), ] elif platform.system() == "Windows": extensions = [ @@ -28,13 +32,19 @@ def build(setup_kwargs): libraries=["taos"], include_dirs=[r"C:\TDengine\include"], library_dirs=[r"C:\TDengine\driver"], - ) + ), + Extension("taos._parser", ["taos/_parser.pyx"], language="c++"), + Extension("taos._objects", ["taos/_objects.pyx"], + libraries=["taos"], + include_dirs=[r"C:\TDengine\include"], + library_dirs=[r"C:\TDengine\driver"], + ), ] else: raise Exception("unsupported platform") setup_kwargs.update({ - "ext_modules": cythonize(extensions, compiler_directives=compiler_directives, nthreads=5, force=True), + "ext_modules": cythonize(extensions, compiler_directives=compiler_directives, force=True), "cmdclass": {"build_ext": build_ext}, }) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 5ede59da..2dccf3e7 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -86,4 +86,7 @@ cdef extern from "taos.h": int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) int taos_stmt_bind_param_batch(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) int taos_get_table_vgId(TAOS *taos, const char *db, const char *table, int *vgId) - int taos_load_table_info(TAOS *taos, const char *tableNameList) \ No newline at end of file + int taos_load_table_info(TAOS *taos, const char *tableNameList) + +cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows) +cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch) diff --git a/taos/_cinterface.pyx b/taos/_cinterface.pyx index 22bbebae..516deabb 100644 --- a/taos/_cinterface.pyx +++ b/taos/_cinterface.pyx @@ -5,22 +5,7 @@ import datetime as dt import pytz from collections import namedtuple from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError -from taos._cinterface cimport * - -_priv_tz = None -_utc_tz = pytz.timezone("UTC") -try: - _datetime_epoch = dt.datetime.fromtimestamp(0) -except OSError: - _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) -_utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) -_priv_datetime_epoch = None - - -def set_tz(tz): - global _priv_tz, _priv_datetime_epoch - _priv_tz = tz - _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) +from taos._parser cimport * cpdef print_type_size(): print("bool:", sizeof(bool)) @@ -43,234 +28,7 @@ cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): return is_null -cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: - with gil: - callback = param - print("callback:", callback, res, code) - dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - fields = taos_fetch_fields(res) - field_count = taos_field_count(res) - taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] - block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) - errno = taos_errno(res) - - if errno != 0: - raise ProgrammingError(taos_errstr(res), errno) - - for row in map(tuple, zip(*block)): - callback(row, taos_fields) - - # --------------------------------------------- parser ---------------------------------------------------------------v -cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): - cdef list res = [] - cdef int i - for i in range(abs(num_of_rows)): - nchar_ptr = ptr + field_length * i - py_string = (nchar_ptr).decode("utf-8") - res.append(py_string) - - return res - -cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): - cdef list res = [] - cdef int i - for i in range(abs(num_of_rows)): - c_char_ptr = ptr + field_length * i - py_string = (c_char_ptr)[:field_length].decode("utf-8") - res.append(py_string) - - return res - -cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): - cdef list res = [] - cdef int i - cdef size_t rbyte_ptr - cdef size_t c_char_ptr - for i in range(abs(num_of_rows)): - if offsets[i] == -1: - res.append(None) - else: - rbyte_ptr = ptr + offsets[i] - rbyte = (rbyte_ptr)[0] - c_char_ptr = rbyte_ptr + sizeof(unsigned short) - py_string = (c_char_ptr)[:rbyte].decode("utf-8") - res.append(py_string) - - return res - -cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): - cdef list res = [] - cdef int i - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - res.append(v_ptr[i]) - - return res - -cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): - cdef list res = [] - cdef int i - cdef double denom = 10**((precision + 1) * 3) - v_ptr = ptr - for i in range(abs(num_of_rows)): - if is_null[i]: - res.append(None) - else: - raw_value = v_ptr[i] - if precision <= 1: - _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) - else: - _dt = raw_value - res.append(_dt) - return res # --------------------------------------------- parser ---------------------------------------------------------------^ SIZED_TYPE = { @@ -372,438 +130,7 @@ cpdef fetch_all(size_t ptr, dt_epoch): return [row for chunk in chunks for row in map(tuple, zip(*chunk))] -cdef class TaosConnection: - cdef char *_host - cdef char *_user - cdef char *_password - cdef char *_database - cdef uint16_t _port - cdef char *_tz - cdef char *_config - cdef TAOS *_raw_conn - - def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): - if host: - host = host.encode("utf-8") - self._host = host - - if user: - user = user.encode("utf-8") - self._user = user - - if password: - password = password.encode("utf-8") - self._password = password - - if database: - database =database.encode("utf-8") - self._database = database - - if port: - self._port = port - - if timezone: - timezone = timezone.encode("utf-8") - self._tz = timezone - - if config: - config = config.encode("utf-8") - self._config = config - - self._init_options() - self._init_conn() - self._check_conn_error() - - def _init_options(self): - if self._tz: - tz = self._tz - set_tz(pytz.timezone(tz.decode("utf-8"))) - taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) - - if self._config: - taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) - - def _init_conn(self): - self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - - def _check_conn_error(self): - errno = taos_errno(self._raw_conn) - if errno != 0: - errstr = taos_errstr(self._raw_conn) - raise ConnectionError(errstr, errno) - - def __dealloc__(self): - self.close() - - def close(self): - if self._raw_conn is not NULL: - taos_close(self._raw_conn) - self._raw_conn = NULL - - @property - def client_info(self): - return (taos_get_client_info()).decode("utf-8") - - @property - def server_info(self): - # type: () -> str - if self._raw_conn is NULL: - return - return (taos_get_server_info(self._raw_conn)).decode("utf-8") - - def select_db(self, database: str): - _database = database.encode("utf-8") - res = taos_select_db(self._raw_conn, _database) - if res != 0: - raise DatabaseError("select database error", res) - - def execute(self, sql: str, req_id: Optional[int] = None): - return self.query(sql, req_id).affected_rows - - def query(self, sql: str, req_id: Optional[int] = None): - _sql = sql.encode("utf-8") - if req_id is None: - res = taos_query(self._raw_conn, _sql) - else: - res = taos_query_with_reqid(self._raw_conn, _sql, req_id) - - return TaosResult(res) - - def query_a(self, sql: str, callback, req_id: Optional[int] = None): - _sql = sql.encode("utf-8") - if req_id is None: - taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) - else: - taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) - - def load_table_info(self, tables: list): - # type: (str) -> None - _tables = ",".join(tables).encode("utf-8") - taos_load_table_info(self._raw_conn, _tables) - - def commit(self): - """Commit any pending transaction to the database. - - Since TDengine do not support transactions, the implement is void functionality. - """ - pass - - def rollback(self): - """Void functionality""" - pass - - def clear_result_set(self): - """Clear unused result set on this connection.""" - pass - - def get_table_vgroup_id(self, db: str, table: str): - # type: (str, str) -> int - """ - get table's vgroup id. It's require db name and table name, and return an int type vgroup id. - """ - cdef int vg_id - _db = db.encode("utf-8") - _table = table.encode("utf-8") - code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) - if code != 0: - raise InternalError(taos_errstr(NULL)) - return vg_id - -cdef class TaosField: - cdef str _name - cdef int8_t _type - cdef int32_t _bytes - - def __cinit__(self, str name, int8_t type_, int32_t bytes): - self._name = name - self._type = type_ - self._bytes = bytes - - @property - def name(self): - return self._name - - @property - def type(self): - return self._type - - @property - def bytes(self): - return self._bytes - - @property - def length(self): - return self._bytes - - def __str__(self): - return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - - def __repr__(self): - return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - - def __getitem__(self, item): - return getattr(self, item) - - -cdef class TaosResult: - cdef TAOS_RES *_res - cdef TAOS_FIELD *_fields - cdef int _field_count - cdef int _precision - cdef int _row_count - cdef int _affected_rows - - def __cinit__(self, size_t res): - self._res = res - self._check_result_error() - self._field_count = taos_field_count(self._res) - self._fields = taos_fetch_fields(self._res) - self._precision = taos_result_precision(self._res) - self._affected_rows = taos_affected_rows(self._res) - self._row_count = 0 - - def __str__(self): - return "TaosResult{res: %s}" % (self._res, ) - - def __repr__(self): - return "TaosResult{res: %s}" % (self._res, ) - - def __iter__(self): - return self.rows_iter() - - @property - def fields(self): - return [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] - - @property - def field_count(self): - return self._field_count - - @property - def precision(self): - return self._precision - - @property - def affected_rows(self): - return self._affected_rows - - @property - def row_count(self): - return self._row_count - - def _check_result_error(self): - errno = taos_errno(self._res) - if errno != 0: - errstr = taos_errstr(self._res) - raise ProgrammingError(errstr, errno) - - def _fetch_block(self): - cdef TAOS_ROW pblock - num_of_rows = taos_fetch_block(self._res, &pblock) - if num_of_rows == 0: - return [], 0 - - blocks = [None] * self._field_count - dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - cdef int i - for i in range(self._field_count): - data = pblock[i] - field = self._fields[i] - - if field.type in UNSIZED_TYPE: - offsets = taos_get_column_data_offset(self._res, i) - blocks[i] = _parse_string(data, num_of_rows, offsets) - elif field.type in SIZED_TYPE: - is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) - else: - pass - - return blocks, abs(num_of_rows) - - def fetch_block(self): - if self._res is NULL: - raise OperationalError("Invalid use of fetch iterator") - - block, num_of_rows = self._fetch_block() - self._row_count += num_of_rows - - return [r for r in map(tuple, zip(*block))], num_of_rows - - def fetch_all(self): - if self._res is NULL: - raise OperationalError("Invalid use of fetchall") - - blocks = [] - while True: - block, num_of_rows = self._fetch_block() - self._check_result_error() - - if num_of_rows == 0: - break - - self._row_count += num_of_rows - blocks.append(block) - - return [r for b in blocks for r in map(tuple, zip(*b))] - - def fetch_all_into_dict(self): - if self._res is NULL: - raise OperationalError("Invalid use of fetchall") - - field_names = [field.name for field in self.fields] - dict_row_cls = namedtuple('DictRow', field_names) - blocks = [] - while True: - block, num_of_rows = self._fetch_block() - self._check_result_error() - - if num_of_rows == 0: - break - - self._row_count += num_of_rows - blocks.append(block) - - return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] - - def rows_iter(self): - if self._res is NULL: - raise OperationalError("Invalid use of rows_iter") - - cdef TAOS_ROW taos_row - cdef int i - dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - is_null = [False] - - while True: - taos_row = taos_fetch_row(self._res) - if taos_row is NULL: - break - - row = [None] * self._field_count - for i in range(self._field_count): - data = taos_row[i] - field = self._fields[i] - if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): - row[i] = _parse_binary_string(data, 1, field.bytes)[0] - elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): - row[i] = _parse_nchar_string(data, 1, field.bytes)[0] - elif field.type in SIZED_TYPE: - row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] - elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] - else: - pass - - self._row_count += 1 - yield row - - def blocks_iter(self): - if self._res is NULL: - raise OperationalError("Invalid use of rows_iter") - - while True: - block, num_of_rows = self._fetch_block() - - if num_of_rows == 0: - break - - yield [r for r in map(tuple, zip(*block))], num_of_rows - - def fetch_rows_a(self, callback): - taos_fetch_rows_a(self._res, async_callback_wrapper, callback) - - def taos_fetch_raw_block_a(self, callback): - taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) - - def __dealloc__(self): - if self._res is not NULL: - taos_free_result(self._res) - - self._res = NULL - self._fields = NULL - - +# ---------------------------------------- Taos Object --------------------------------------------------------------- v -# class TaosStmt(object): -# cdef TAOS_STMT *_stmt -# -# def __cinit__(self, size_t stmt): -# self._stmt = stmt -# -# def set_tbname(self, name: str): -# if self._stmt is NULL: -# raise StatementError("Invalid use of set_tbname") -# -# _name = name.decode("utf-8") -# taos_stmt_set_tbname(self._stmt, _name) -# -# def prepare(self, sql: str): -# _sql = sql.decode("utf-8") -# taos_stmt_prepare(self._stmt, _sql, len(_sql)) -# -# def set_tbname_tags(self, name: str, tags: list): -# # type: (str, Array[TaosBind]) -> None -# """Set table name with tags, tags is array of BindParams""" -# if self._stmt is NULL: -# raise StatementError("Invalid use of set_tbname_tags") -# taos_stmt_set_tbname_tags(self._stmt, name, NULL) -# -# def bind_param(self, params, add_batch=True): -# # type: (Array[TaosBind], bool) -> None -# if self._stmt is None: -# raise StatementError("Invalid use of stmt") -# taos_stmt_bind_param(self._stmt, params) -# if add_batch: -# taos_stmt_add_batch(self._stmt) -# -# def bind_param_batch(self, binds, add_batch=True): -# # type: (Array[TaosMultiBind], bool) -> None -# if self._stmt is NULL: -# raise StatementError("Invalid use of stmt") -# taos_stmt_bind_param_batch(self._stmt, binds) -# if add_batch: -# taos_stmt_add_batch(self._stmt) -# -# def add_batch(self): -# if self._stmt is NULL: -# raise StatementError("Invalid use of stmt") -# taos_stmt_add_batch(self._stmt) -# -# def execute(self): -# if self._stmt is NULL: -# raise StatementError("Invalid use of execute") -# taos_stmt_execute(self._stmt) -# -# def use_result(self): -# """NOTE: Don't use a stmt result more than once.""" -# result = taos_stmt_use_result(self._stmt) -# return TaosResult(result) -# -# @property -# def affected_rows(self): -# # type: () -> int -# return taos_stmt_affected_rows(self._stmt) -# -# def close(self): -# """Close stmt.""" -# if self._stmt is NULL: -# return -# taos_stmt_close(self._stmt) -# self._stmt = NULL -# -# def __dealloc__(self): -# self.close() -# -# -# class TaosMultiBind: -# cdef int buffer_type -# cdef void *buffer -# cdef uintptr_t buffer_length -# cdef int32_t *length -# cdef char *is_null -# cdef int num +# ---------------------------------------- Taos Object --------------------------------------------------------------- ^ diff --git a/taos/_objects.pyx b/taos/_objects.pyx new file mode 100644 index 00000000..44cb92ab --- /dev/null +++ b/taos/_objects.pyx @@ -0,0 +1,476 @@ +# cython: profile=True + +from taos._cinterface cimport * +from taos._parser cimport * +from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC +import datetime as dt +import pytz +from collections import namedtuple +from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError + +_priv_tz = None +_utc_tz = pytz.timezone("UTC") +try: + _datetime_epoch = dt.datetime.fromtimestamp(0) +except OSError: + _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) +_utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) +_priv_datetime_epoch = None + + +def set_tz(tz): + global _priv_tz, _priv_datetime_epoch + _priv_tz = tz + _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) + +cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: + with gil: + callback = param + print("callback:", callback, res, code) + dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + fields = taos_fetch_fields(res) + field_count = taos_field_count(res) + taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] + block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) + errno = taos_errno(res) + + if errno != 0: + raise ProgrammingError(taos_errstr(res), errno) + + for row in map(tuple, zip(*block)): + callback(row, taos_fields) + + +cdef class TaosConnection: + cdef char *_host + cdef char *_user + cdef char *_password + cdef char *_database + cdef uint16_t _port + cdef char *_tz + cdef char *_config + cdef TAOS *_raw_conn + + def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): + if host: + host = host.encode("utf-8") + self._host = host + + if user: + user = user.encode("utf-8") + self._user = user + + if password: + password = password.encode("utf-8") + self._password = password + + if database: + database =database.encode("utf-8") + self._database = database + + if port: + self._port = port + + if timezone: + timezone = timezone.encode("utf-8") + self._tz = timezone + + if config: + config = config.encode("utf-8") + self._config = config + + self._init_options() + self._init_conn() + self._check_conn_error() + + def _init_options(self): + if self._tz: + tz = self._tz + set_tz(pytz.timezone(tz.decode("utf-8"))) + taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) + + if self._config: + taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + + def _init_conn(self): + self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + + def _check_conn_error(self): + errno = taos_errno(self._raw_conn) + if errno != 0: + errstr = taos_errstr(self._raw_conn) + raise ConnectionError(errstr, errno) + + def __dealloc__(self): + self.close() + + def close(self): + if self._raw_conn is not NULL: + taos_close(self._raw_conn) + self._raw_conn = NULL + + @property + def client_info(self): + return (taos_get_client_info()).decode("utf-8") + + @property + def server_info(self): + # type: () -> str + if self._raw_conn is NULL: + return + return (taos_get_server_info(self._raw_conn)).decode("utf-8") + + def select_db(self, database: str): + _database = database.encode("utf-8") + res = taos_select_db(self._raw_conn, _database) + if res != 0: + raise DatabaseError("select database error", res) + + def execute(self, sql: str, req_id: Optional[int] = None): + return self.query(sql, req_id).affected_rows + + def query(self, sql: str, req_id: Optional[int] = None): + _sql = sql.encode("utf-8") + if req_id is None: + res = taos_query(self._raw_conn, _sql) + else: + res = taos_query_with_reqid(self._raw_conn, _sql, req_id) + + return TaosResult(res) + + def query_a(self, sql: str, callback, req_id: Optional[int] = None): + _sql = sql.encode("utf-8") + if req_id is None: + taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) + else: + taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + + def load_table_info(self, tables: list): + # type: (str) -> None + _tables = ",".join(tables).encode("utf-8") + taos_load_table_info(self._raw_conn, _tables) + + def commit(self): + """Commit any pending transaction to the database. + + Since TDengine do not support transactions, the implement is void functionality. + """ + pass + + def rollback(self): + """Void functionality""" + pass + + def clear_result_set(self): + """Clear unused result set on this connection.""" + pass + + def get_table_vgroup_id(self, db: str, table: str): + # type: (str, str) -> int + """ + get table's vgroup id. It's require db name and table name, and return an int type vgroup id. + """ + cdef int vg_id + _db = db.encode("utf-8") + _table = table.encode("utf-8") + code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) + if code != 0: + raise InternalError(taos_errstr(NULL)) + return vg_id + + +cdef class TaosField: + cdef str _name + cdef int8_t _type + cdef int32_t _bytes + + def __cinit__(self, str name, int8_t type_, int32_t bytes): + self._name = name + self._type = type_ + self._bytes = bytes + + @property + def name(self): + return self._name + + @property + def type(self): + return self._type + + @property + def bytes(self): + return self._bytes + + @property + def length(self): + return self._bytes + + def __str__(self): + return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + + def __repr__(self): + return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + + def __getitem__(self, item): + return getattr(self, item) + + +cdef class TaosResult: + cdef TAOS_RES *_res + cdef TAOS_FIELD *_fields + cdef int _field_count + cdef int _precision + cdef int _row_count + cdef int _affected_rows + + def __cinit__(self, size_t res): + self._res = res + self._check_result_error() + self._field_count = taos_field_count(self._res) + self._fields = taos_fetch_fields(self._res) + self._precision = taos_result_precision(self._res) + self._affected_rows = taos_affected_rows(self._res) + self._row_count = 0 + + def __str__(self): + return "TaosResult{res: %s}" % (self._res, ) + + def __repr__(self): + return "TaosResult{res: %s}" % (self._res, ) + + def __iter__(self): + return self.rows_iter() + + @property + def fields(self): + return [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] + + @property + def field_count(self): + return self._field_count + + @property + def precision(self): + return self._precision + + @property + def affected_rows(self): + return self._affected_rows + + @property + def row_count(self): + return self._row_count + + def _check_result_error(self): + errno = taos_errno(self._res) + if errno != 0: + errstr = taos_errstr(self._res) + raise ProgrammingError(errstr, errno) + + def _fetch_block(self): + cdef TAOS_ROW pblock + num_of_rows = taos_fetch_block(self._res, &pblock) + if num_of_rows == 0: + return [], 0 + + blocks = [None] * self._field_count + dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + cdef int i + for i in range(self._field_count): + data = pblock[i] + field = self._fields[i] + + if field.type in UNSIZED_TYPE: + offsets = taos_get_column_data_offset(self._res, i) + blocks[i] = _parse_string(data, num_of_rows, offsets) + elif field.type in SIZED_TYPE: + is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) + else: + pass + + return blocks, abs(num_of_rows) + + def fetch_block(self): + if self._res is NULL: + raise OperationalError("Invalid use of fetch iterator") + + block, num_of_rows = self._fetch_block() + self._row_count += num_of_rows + + return [r for r in map(tuple, zip(*block))], num_of_rows + + def fetch_all(self): + if self._res is NULL: + raise OperationalError("Invalid use of fetchall") + + blocks = [] + while True: + block, num_of_rows = self._fetch_block() + self._check_result_error() + + if num_of_rows == 0: + break + + self._row_count += num_of_rows + blocks.append(block) + + return [r for b in blocks for r in map(tuple, zip(*b))] + + def fetch_all_into_dict(self): + if self._res is NULL: + raise OperationalError("Invalid use of fetchall") + + field_names = [field.name for field in self.fields] + dict_row_cls = namedtuple('DictRow', field_names) + blocks = [] + while True: + block, num_of_rows = self._fetch_block() + self._check_result_error() + + if num_of_rows == 0: + break + + self._row_count += num_of_rows + blocks.append(block) + + return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] + + def rows_iter(self): + if self._res is NULL: + raise OperationalError("Invalid use of rows_iter") + + cdef TAOS_ROW taos_row + cdef int i + dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + is_null = [False] + + while True: + taos_row = taos_fetch_row(self._res) + if taos_row is NULL: + break + + row = [None] * self._field_count + for i in range(self._field_count): + data = taos_row[i] + field = self._fields[i] + if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): + row[i] = _parse_binary_string(data, 1, field.bytes)[0] + elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): + row[i] = _parse_nchar_string(data, 1, field.bytes)[0] + elif field.type in SIZED_TYPE: + row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] + elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] + else: + pass + + self._row_count += 1 + yield row + + def blocks_iter(self): + if self._res is NULL: + raise OperationalError("Invalid use of rows_iter") + + while True: + block, num_of_rows = self._fetch_block() + + if num_of_rows == 0: + break + + yield [r for r in map(tuple, zip(*block))], num_of_rows + + def fetch_rows_a(self, callback): + taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + + def taos_fetch_raw_block_a(self, callback): + taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) + + def __dealloc__(self): + if self._res is not NULL: + taos_free_result(self._res) + + self._res = NULL + self._fields = NULL + +# class TaosStmt(object): +# cdef TAOS_STMT *_stmt +# +# def __cinit__(self, size_t stmt): +# self._stmt = stmt +# +# def set_tbname(self, name: str): +# if self._stmt is NULL: +# raise StatementError("Invalid use of set_tbname") +# +# _name = name.decode("utf-8") +# taos_stmt_set_tbname(self._stmt, _name) +# +# def prepare(self, sql: str): +# _sql = sql.decode("utf-8") +# taos_stmt_prepare(self._stmt, _sql, len(_sql)) +# +# def set_tbname_tags(self, name: str, tags: list): +# # type: (str, Array[TaosBind]) -> None +# """Set table name with tags, tags is array of BindParams""" +# if self._stmt is NULL: +# raise StatementError("Invalid use of set_tbname_tags") +# taos_stmt_set_tbname_tags(self._stmt, name, NULL) +# +# def bind_param(self, params, add_batch=True): +# # type: (Array[TaosBind], bool) -> None +# if self._stmt is None: +# raise StatementError("Invalid use of stmt") +# taos_stmt_bind_param(self._stmt, params) +# if add_batch: +# taos_stmt_add_batch(self._stmt) +# +# def bind_param_batch(self, binds, add_batch=True): +# # type: (Array[TaosMultiBind], bool) -> None +# if self._stmt is NULL: +# raise StatementError("Invalid use of stmt") +# taos_stmt_bind_param_batch(self._stmt, binds) +# if add_batch: +# taos_stmt_add_batch(self._stmt) +# +# def add_batch(self): +# if self._stmt is NULL: +# raise StatementError("Invalid use of stmt") +# taos_stmt_add_batch(self._stmt) +# +# def execute(self): +# if self._stmt is NULL: +# raise StatementError("Invalid use of execute") +# taos_stmt_execute(self._stmt) +# +# def use_result(self): +# """NOTE: Don't use a stmt result more than once.""" +# result = taos_stmt_use_result(self._stmt) +# return TaosResult(result) +# +# @property +# def affected_rows(self): +# # type: () -> int +# return taos_stmt_affected_rows(self._stmt) +# +# def close(self): +# """Close stmt.""" +# if self._stmt is NULL: +# return +# taos_stmt_close(self._stmt) +# self._stmt = NULL +# +# def __dealloc__(self): +# self.close() +# +# +# class TaosMultiBind: +# cdef int buffer_type +# cdef void *buffer +# cdef uintptr_t buffer_length +# cdef int32_t *length +# cdef char *is_null +# cdef int num diff --git a/taos/_parser.pxd b/taos/_parser.pxd new file mode 100644 index 00000000..bdc81111 --- /dev/null +++ b/taos/_parser.pxd @@ -0,0 +1,36 @@ +from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t +from libcpp cimport bool + +cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length) + +cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length) + +cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets) + +cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_int(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_float(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_double(size_t ptr, int num_of_rows, list is_null) + +cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch) \ No newline at end of file diff --git a/taos/_parser.pyx b/taos/_parser.pyx new file mode 100644 index 00000000..af5cbce1 --- /dev/null +++ b/taos/_parser.pyx @@ -0,0 +1,211 @@ +import datetime as dt + +cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): + cdef list res = [] + cdef int i + for i in range(abs(num_of_rows)): + nchar_ptr = ptr + field_length * i + py_string = (nchar_ptr).decode("utf-8") + res.append(py_string) + + return res + +cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): + cdef list res = [] + cdef int i + for i in range(abs(num_of_rows)): + c_char_ptr = ptr + field_length * i + py_string = (c_char_ptr)[:field_length].decode("utf-8") + res.append(py_string) + + return res + +cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): + cdef list res = [] + cdef int i + cdef size_t rbyte_ptr + cdef size_t c_char_ptr + for i in range(abs(num_of_rows)): + if offsets[i] == -1: + res.append(None) + else: + rbyte_ptr = ptr + offsets[i] + rbyte = (rbyte_ptr)[0] + c_char_ptr = rbyte_ptr + sizeof(unsigned short) + py_string = (c_char_ptr)[:rbyte].decode("utf-8") + res.append(py_string) + + return res + +cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): + cdef list res = [] + cdef int i + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + res.append(v_ptr[i]) + + return res + +cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): + cdef list res = [] + cdef int i + cdef double denom = 10**((precision + 1) * 3) + v_ptr = ptr + for i in range(abs(num_of_rows)): + if is_null[i]: + res.append(None) + else: + raw_value = v_ptr[i] + if precision <= 1: + _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) + else: + _dt = raw_value + res.append(_dt) + return res From e819e7c7fa21d62b592517ec2521eb02a6b06c1d Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Fri, 25 Aug 2023 17:39:50 +0800 Subject: [PATCH 06/31] perf: using cython 1. add TaosCusor 2. add TaosConsumer and TaosTopicAssignment --- poetry.lock | 987 ++ taos/_cinterface.c | 10569 +++++++++++++ taos/_cinterface.pxd | 52 +- taos/_cinterface.pyx | 16 +- taos/_objects.c | 33552 +++++++++++++++++++++++++++++++++++++++++ taos/_objects.pyx | 272 +- taos/_parser.cpp | 7259 +++++++++ taos/_parser.pxd | 2 +- taos/_parser.pyx | 4 +- temp | 30 + 10 files changed, 52707 insertions(+), 36 deletions(-) create mode 100644 poetry.lock create mode 100644 taos/_cinterface.c create mode 100644 taos/_objects.c create mode 100644 taos/_parser.cpp create mode 100644 temp diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..8d03f0d3 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,987 @@ +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. + +[[package]] +name = "atomicwrites" +version = "1.4.1" +description = "Atomic file writes." +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "atomicwrites-1.4.1.tar.gz", hash = "sha256:81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11"}, +] + +[[package]] +name = "attrs" +version = "23.1.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.7" +files = [ + {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, + {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, +] + +[package.dependencies] +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} + +[package.extras] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[docs,tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] + +[[package]] +name = "black" +version = "22.8.0" +description = "The uncompromising code formatter." +optional = false +python-versions = ">=3.6.2" +files = [ + {file = "black-22.8.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ce957f1d6b78a8a231b18e0dd2d94a33d2ba738cd88a7fe64f53f659eea49fdd"}, + {file = "black-22.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5107ea36b2b61917956d018bd25129baf9ad1125e39324a9b18248d362156a27"}, + {file = "black-22.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e8166b7bfe5dcb56d325385bd1d1e0f635f24aae14b3ae437102dedc0c186747"}, + {file = "black-22.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd82842bb272297503cbec1a2600b6bfb338dae017186f8f215c8958f8acf869"}, + {file = "black-22.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d839150f61d09e7217f52917259831fe2b689f5c8e5e32611736351b89bb2a90"}, + {file = "black-22.8.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a05da0430bd5ced89176db098567973be52ce175a55677436a271102d7eaa3fe"}, + {file = "black-22.8.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a098a69a02596e1f2a58a2a1c8d5a05d5a74461af552b371e82f9fa4ada8342"}, + {file = "black-22.8.0-cp36-cp36m-win_amd64.whl", hash = "sha256:5594efbdc35426e35a7defa1ea1a1cb97c7dbd34c0e49af7fb593a36bd45edab"}, + {file = "black-22.8.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a983526af1bea1e4cf6768e649990f28ee4f4137266921c2c3cee8116ae42ec3"}, + {file = "black-22.8.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b2c25f8dea5e8444bdc6788a2f543e1fb01494e144480bc17f806178378005e"}, + {file = "black-22.8.0-cp37-cp37m-win_amd64.whl", hash = "sha256:78dd85caaab7c3153054756b9fe8c611efa63d9e7aecfa33e533060cb14b6d16"}, + {file = "black-22.8.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:cea1b2542d4e2c02c332e83150e41e3ca80dc0fb8de20df3c5e98e242156222c"}, + {file = "black-22.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5b879eb439094751185d1cfdca43023bc6786bd3c60372462b6f051efa6281a5"}, + {file = "black-22.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0a12e4e1353819af41df998b02c6742643cfef58282915f781d0e4dd7a200411"}, + {file = "black-22.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3a73f66b6d5ba7288cd5d6dad9b4c9b43f4e8a4b789a94bf5abfb878c663eb3"}, + {file = "black-22.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:e981e20ec152dfb3e77418fb616077937378b322d7b26aa1ff87717fb18b4875"}, + {file = "black-22.8.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8ce13ffed7e66dda0da3e0b2eb1bdfc83f5812f66e09aca2b0978593ed636b6c"}, + {file = "black-22.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:32a4b17f644fc288c6ee2bafdf5e3b045f4eff84693ac069d87b1a347d861497"}, + {file = "black-22.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0ad827325a3a634bae88ae7747db1a395d5ee02cf05d9aa7a9bd77dfb10e940c"}, + {file = "black-22.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53198e28a1fb865e9fe97f88220da2e44df6da82b18833b588b1883b16bb5d41"}, + {file = "black-22.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:bc4d4123830a2d190e9cc42a2e43570f82ace35c3aeb26a512a2102bce5af7ec"}, + {file = "black-22.8.0-py3-none-any.whl", hash = "sha256:d2c21d439b2baf7aa80d6dd4e3659259be64c6f49dfd0f32091063db0e006db4"}, + {file = "black-22.8.0.tar.gz", hash = "sha256:792f7eb540ba9a17e8656538701d3eb1afcb134e3b45b71f20b25c77a8db7e6e"}, +] + +[package.dependencies] +click = ">=8.0.0" +dataclasses = {version = ">=0.6", markers = "python_version < \"3.7\""} +mypy-extensions = ">=0.4.3" +pathspec = ">=0.9.0" +platformdirs = ">=2" +tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} +typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} +typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.7.4)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + +[[package]] +name = "certifi" +version = "2023.7.22" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, +] + +[[package]] +name = "charset-normalizer" +version = "2.0.12" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.5.0" +files = [ + {file = "charset-normalizer-2.0.12.tar.gz", hash = "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597"}, + {file = "charset_normalizer-2.0.12-py3-none-any.whl", hash = "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df"}, +] + +[package.extras] +unicode-backport = ["unicodedata2"] + +[[package]] +name = "click" +version = "8.0.4" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.6" +files = [ + {file = "click-8.0.4-py3-none-any.whl", hash = "sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1"}, + {file = "click-8.0.4.tar.gz", hash = "sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "coverage" +version = "6.2" +description = "Code coverage measurement for Python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "coverage-6.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6dbc1536e105adda7a6312c778f15aaabe583b0e9a0b0a324990334fd458c94b"}, + {file = "coverage-6.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:174cf9b4bef0db2e8244f82059a5a72bd47e1d40e71c68ab055425172b16b7d0"}, + {file = "coverage-6.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:92b8c845527eae547a2a6617d336adc56394050c3ed8a6918683646328fbb6da"}, + {file = "coverage-6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c7912d1526299cb04c88288e148c6c87c0df600eca76efd99d84396cfe00ef1d"}, + {file = "coverage-6.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d5d2033d5db1d58ae2d62f095e1aefb6988af65b4b12cb8987af409587cc0739"}, + {file = "coverage-6.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3feac4084291642165c3a0d9eaebedf19ffa505016c4d3db15bfe235718d4971"}, + {file = "coverage-6.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:276651978c94a8c5672ea60a2656e95a3cce2a3f31e9fb2d5ebd4c215d095840"}, + {file = "coverage-6.2-cp310-cp310-win32.whl", hash = "sha256:f506af4f27def639ba45789fa6fde45f9a217da0be05f8910458e4557eed020c"}, + {file = "coverage-6.2-cp310-cp310-win_amd64.whl", hash = "sha256:3f7c17209eef285c86f819ff04a6d4cbee9b33ef05cbcaae4c0b4e8e06b3ec8f"}, + {file = "coverage-6.2-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:13362889b2d46e8d9f97c421539c97c963e34031ab0cb89e8ca83a10cc71ac76"}, + {file = "coverage-6.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:22e60a3ca5acba37d1d4a2ee66e051f5b0e1b9ac950b5b0cf4aa5366eda41d47"}, + {file = "coverage-6.2-cp311-cp311-win_amd64.whl", hash = "sha256:b637c57fdb8be84e91fac60d9325a66a5981f8086c954ea2772efe28425eaf64"}, + {file = "coverage-6.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f467bbb837691ab5a8ca359199d3429a11a01e6dfb3d9dcc676dc035ca93c0a9"}, + {file = "coverage-6.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2641f803ee9f95b1f387f3e8f3bf28d83d9b69a39e9911e5bfee832bea75240d"}, + {file = "coverage-6.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:1219d760ccfafc03c0822ae2e06e3b1248a8e6d1a70928966bafc6838d3c9e48"}, + {file = "coverage-6.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9a2b5b52be0a8626fcbffd7e689781bf8c2ac01613e77feda93d96184949a98e"}, + {file = "coverage-6.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:8e2c35a4c1f269704e90888e56f794e2d9c0262fb0c1b1c8c4ee44d9b9e77b5d"}, + {file = "coverage-6.2-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:5d6b09c972ce9200264c35a1d53d43ca55ef61836d9ec60f0d44273a31aa9f17"}, + {file = "coverage-6.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e3db840a4dee542e37e09f30859f1612da90e1c5239a6a2498c473183a50e781"}, + {file = "coverage-6.2-cp36-cp36m-win32.whl", hash = "sha256:4e547122ca2d244f7c090fe3f4b5a5861255ff66b7ab6d98f44a0222aaf8671a"}, + {file = "coverage-6.2-cp36-cp36m-win_amd64.whl", hash = "sha256:01774a2c2c729619760320270e42cd9e797427ecfddd32c2a7b639cdc481f3c0"}, + {file = "coverage-6.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:fb8b8ee99b3fffe4fd86f4c81b35a6bf7e4462cba019997af2fe679365db0c49"}, + {file = "coverage-6.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:619346d57c7126ae49ac95b11b0dc8e36c1dd49d148477461bb66c8cf13bb521"}, + {file = "coverage-6.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0a7726f74ff63f41e95ed3a89fef002916c828bb5fcae83b505b49d81a066884"}, + {file = "coverage-6.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cfd9386c1d6f13b37e05a91a8583e802f8059bebfccde61a418c5808dea6bbfa"}, + {file = "coverage-6.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:17e6c11038d4ed6e8af1407d9e89a2904d573be29d51515f14262d7f10ef0a64"}, + {file = "coverage-6.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c254b03032d5a06de049ce8bca8338a5185f07fb76600afff3c161e053d88617"}, + {file = "coverage-6.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dca38a21e4423f3edb821292e97cec7ad38086f84313462098568baedf4331f8"}, + {file = "coverage-6.2-cp37-cp37m-win32.whl", hash = "sha256:600617008aa82032ddeace2535626d1bc212dfff32b43989539deda63b3f36e4"}, + {file = "coverage-6.2-cp37-cp37m-win_amd64.whl", hash = "sha256:bf154ba7ee2fd613eb541c2bc03d3d9ac667080a737449d1a3fb342740eb1a74"}, + {file = "coverage-6.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f9afb5b746781fc2abce26193d1c817b7eb0e11459510fba65d2bd77fe161d9e"}, + {file = "coverage-6.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edcada2e24ed68f019175c2b2af2a8b481d3d084798b8c20d15d34f5c733fa58"}, + {file = "coverage-6.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a9c8c4283e17690ff1a7427123ffb428ad6a52ed720d550e299e8291e33184dc"}, + {file = "coverage-6.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f614fc9956d76d8a88a88bb41ddc12709caa755666f580af3a688899721efecd"}, + {file = "coverage-6.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9365ed5cce5d0cf2c10afc6add145c5037d3148585b8ae0e77cc1efdd6aa2953"}, + {file = "coverage-6.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8bdfe9ff3a4ea37d17f172ac0dff1e1c383aec17a636b9b35906babc9f0f5475"}, + {file = "coverage-6.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:63c424e6f5b4ab1cf1e23a43b12f542b0ec2e54f99ec9f11b75382152981df57"}, + {file = "coverage-6.2-cp38-cp38-win32.whl", hash = "sha256:49dbff64961bc9bdd2289a2bda6a3a5a331964ba5497f694e2cbd540d656dc1c"}, + {file = "coverage-6.2-cp38-cp38-win_amd64.whl", hash = "sha256:9a29311bd6429be317c1f3fe4bc06c4c5ee45e2fa61b2a19d4d1d6111cb94af2"}, + {file = "coverage-6.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:03b20e52b7d31be571c9c06b74746746d4eb82fc260e594dc662ed48145e9efd"}, + {file = "coverage-6.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:215f8afcc02a24c2d9a10d3790b21054b58d71f4b3c6f055d4bb1b15cecce685"}, + {file = "coverage-6.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a4bdeb0a52d1d04123b41d90a4390b096f3ef38eee35e11f0b22c2d031222c6c"}, + {file = "coverage-6.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c332d8f8d448ded473b97fefe4a0983265af21917d8b0cdcb8bb06b2afe632c3"}, + {file = "coverage-6.2-cp39-cp39-win32.whl", hash = "sha256:6e1394d24d5938e561fbeaa0cd3d356207579c28bd1792f25a068743f2d5b282"}, + {file = "coverage-6.2-cp39-cp39-win_amd64.whl", hash = "sha256:86f2e78b1eff847609b1ca8050c9e1fa3bd44ce755b2ec30e70f2d3ba3844644"}, + {file = "coverage-6.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:5829192582c0ec8ca4a2532407bc14c2f338d9878a10442f5d03804a95fac9de"}, + {file = "coverage-6.2.tar.gz", hash = "sha256:e2cad8093172b7d1595b4ad66f24270808658e11acf43a8f95b41276162eb5b8"}, +] + +[package.dependencies] +tomli = {version = "*", optional = true, markers = "extra == \"toml\""} + +[package.extras] +toml = ["tomli"] + +[[package]] +name = "cython" +version = "3.0.0" +description = "The Cython compiler for writing C extensions in the Python language." +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "Cython-3.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7c7d728e1a49ad01d41181e3a9ea80b8d14e825f4679e4dd837cbf7bca7998a5"}, + {file = "Cython-3.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:626a4a6ef4b7ced87c348ea805488e4bd39dad9d0b39659aa9e1040b62bbfedf"}, + {file = "Cython-3.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:33c900d1ca9f622b969ac7d8fc44bdae140a4a6c7d8819413b51f3ccd0586a09"}, + {file = "Cython-3.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a65bc50dc1bc2faeafd9425defbdef6a468974f5c4192497ff7f14adccfdcd32"}, + {file = "Cython-3.0.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3b71b399b10b038b056ad12dce1e317a8aa7a96e99de7e4fa2fa5d1c9415cfb9"}, + {file = "Cython-3.0.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f42f304c097cc53e9eb5f1a1d150380353d5018a3191f1b77f0de353c762181e"}, + {file = "Cython-3.0.0-cp310-cp310-win32.whl", hash = "sha256:3e234e2549e808d9259fdb23ebcfd145be30c638c65118326ec33a8d29248dc2"}, + {file = "Cython-3.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:829c8333195100448a23863cf64a07e1334fae6a275aefe871458937911531b6"}, + {file = "Cython-3.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:06db81b1a01858fcc406616f8528e686ffb6cf7c3d78fb83767832bfecea8ad8"}, + {file = "Cython-3.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c93634845238645ce7abf63a56b1c5b6248189005c7caff898fd4a0dac1c5e1e"}, + {file = "Cython-3.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa606675c6bd23478b1d174e2a84e3c5a2c660968f97dc455afe0fae198f9d3d"}, + {file = "Cython-3.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d3355e6f690184f984eeb108b0f5bbc4bcf8b9444f8168933acf79603abf7baf"}, + {file = "Cython-3.0.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:93a34e1ca8afa4b7075b02ed14a7e4969256297029fb1bfd4cbe48f7290dbcff"}, + {file = "Cython-3.0.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bb1165ca9e78823f9ad1efa5b3d83156f868eabd679a615d140a3021bb92cd65"}, + {file = "Cython-3.0.0-cp311-cp311-win32.whl", hash = "sha256:2fadde1da055944f5e1e17625055f54ddd11f451889110278ef30e07bd5e1695"}, + {file = "Cython-3.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:254ed1f03a6c237fa64f0c6e44862058de65bfa2e6a3b48ca3c205492e0653aa"}, + {file = "Cython-3.0.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:4e212237b7531759befb92699c452cd65074a78051ae4ee36ff8b237395ecf3d"}, + {file = "Cython-3.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f29307463eba53747b31f71394ed087e3e3e264dcc433e62de1d51f5c0c966c"}, + {file = "Cython-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53328a8af0806bebbdb48a4191883b11ee9d9dfb084d84f58fa5a8ab58baefc9"}, + {file = "Cython-3.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5962e70b15e863e72bed6910e8c6ffef77d36cc98e2b31c474378f3b9e49b0e3"}, + {file = "Cython-3.0.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9e69139f4e60ab14c50767a568612ea64d6907e9c8e0289590a170eb495e005f"}, + {file = "Cython-3.0.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c40bdbcb2286f0aeeb5df9ce53d45da2d2a9b36a16b331cd0809d212d22a8fc7"}, + {file = "Cython-3.0.0-cp312-cp312-win32.whl", hash = "sha256:8abb8915eb2e57fa53d918afe641c05d1bcc6ed1913682ec1f28de71f4e3f398"}, + {file = "Cython-3.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:30a4bd2481e59bd7ab2539f835b78edc19fc455811e476916f56026b93afd28b"}, + {file = "Cython-3.0.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:0e1e4b7e4bfbf22fecfa5b852f0e499c442d4853b7ebd33ae37cdec9826ed5d8"}, + {file = "Cython-3.0.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b00df42cdd1a285a64491ba23de08ab14169d3257c840428d40eb7e8e9979af"}, + {file = "Cython-3.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:650d03ddddc08b051b4659778733f0f173ca7d327415755c05d265a6c1ba02fb"}, + {file = "Cython-3.0.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4965f2ebade17166f21a508d66dd60d2a0b3a3b90abe3f72003baa17ae020dd6"}, + {file = "Cython-3.0.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:4123c8d03167803df31da6b39de167cb9c04ac0aa4e35d4e5aa9d08ad511b84d"}, + {file = "Cython-3.0.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:296c53b6c0030cf82987eef163444e8d7631cc139d995f9d58679d9fd1ddbf31"}, + {file = "Cython-3.0.0-cp36-cp36m-win32.whl", hash = "sha256:0d2c1e172f1c81bafcca703093608e10dc16e3e2d24c5644c17606c7fdb1792c"}, + {file = "Cython-3.0.0-cp36-cp36m-win_amd64.whl", hash = "sha256:bc816d8eb3686d6f8d165f4156bac18c1147e1035dc28a76742d0b7fb5b7c032"}, + {file = "Cython-3.0.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8d86651347bbdbac1aca1824696c5e4c0a3b162946c422edcca2be12a03744d1"}, + {file = "Cython-3.0.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:84176bd04ce9f3cc8799b47ec6d1959fa1ea5e71424507df7bbf0b0915bbedef"}, + {file = "Cython-3.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35abcf07b8277ec95bbe49a07b5c8760a2d941942ccfe759a94c8d2fe5602e9f"}, + {file = "Cython-3.0.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a44d6b9a29b2bff38bb648577b2fcf6a68cf8b1783eee89c2eb749f69494b98d"}, + {file = "Cython-3.0.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:4dc6bbe7cf079db37f1ebb9b0f10d0d7f29e293bb8688e92d50b5ea7a91d82f3"}, + {file = "Cython-3.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e28763e75e380b8be62b02266a7995a781997c97c119efbdccb8fb954bcd7574"}, + {file = "Cython-3.0.0-cp37-cp37m-win32.whl", hash = "sha256:edae615cb4af51d5173e76ba9aea212424d025c57012e9cdf2f131f774c5ba71"}, + {file = "Cython-3.0.0-cp37-cp37m-win_amd64.whl", hash = "sha256:20c604e974832aaf8b7a1f5455ee7274b34df62a35ee095cd7d2ed7e818e6c53"}, + {file = "Cython-3.0.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c85fd2b1cbd9400d60ebe074795bb9a9188752f1612be3b35b0831a24879b91f"}, + {file = "Cython-3.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:090256c687106932339f87f888b95f0d69c617bc9b18801555545b695d29d8ab"}, + {file = "Cython-3.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cec2a67a0a7d9d4399758c0657ca03e5912e37218859cfbf046242cc532bfb3b"}, + {file = "Cython-3.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a1cdd01ce45333bc264a218c6e183700d6b998f029233f586a53c9b13455c2d2"}, + {file = "Cython-3.0.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ecee663d2d50ca939fc5db81f2f8a219c2417b4651ad84254c50a03a9cb1aadd"}, + {file = "Cython-3.0.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:30f10e79393b411af7677c270ea69807acb9fc30205c8ff25561f4deef780ec1"}, + {file = "Cython-3.0.0-cp38-cp38-win32.whl", hash = "sha256:609777d3a7a0a23b225e84d967af4ad2485c8bdfcacef8037cf197e87d431ca0"}, + {file = "Cython-3.0.0-cp38-cp38-win_amd64.whl", hash = "sha256:7f4a6dfd42ae0a45797f50fc4f6add702abf46ab3e7cd61811a6c6a97a40e1a2"}, + {file = "Cython-3.0.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2d8158277c8942c0b20ff4c074fe6a51c5b89e6ac60cef606818de8c92773596"}, + {file = "Cython-3.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54e34f99b2a8c1e11478541b2822e6408c132b98b6b8f5ed89411e5e906631ea"}, + {file = "Cython-3.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:877d1c8745df59dd2061a0636c602729e9533ba13f13aa73a498f68662e1cbde"}, + {file = "Cython-3.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:204690be60f0ff32eb70b04f28ef0d1e50ffd7b3f77ba06a7dc2389ee3b848e0"}, + {file = "Cython-3.0.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:06fcb4628ccce2ba5abc8630adbeaf4016f63a359b4c6c3827b2d80e0673981c"}, + {file = "Cython-3.0.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:090e24cfa31c926d0b13d8bb2ef48175acdd061ae1413343c94a2b12a4a4fa6f"}, + {file = "Cython-3.0.0-cp39-cp39-win32.whl", hash = "sha256:4cd00f2158dc00f7f93a92444d0f663eda124c9c29bbbd658964f4e89c357fe8"}, + {file = "Cython-3.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:5b4cc896d49ce2bae8d6a030f9a4c64965b59c38acfbf4617685e17f7fcf1731"}, + {file = "Cython-3.0.0-py2.py3-none-any.whl", hash = "sha256:ff1aef1a03cfe293237c7a86ae9625b0411b2df30c53d1a7f29a8d381f38a1df"}, + {file = "Cython-3.0.0.tar.gz", hash = "sha256:350b18f9673e63101dbbfcf774ee2f57c20ac4636d255741d76ca79016b1bd82"}, +] + +[[package]] +name = "dataclasses" +version = "0.8" +description = "A backport of the dataclasses module for Python 3.6" +optional = false +python-versions = ">=3.6, <3.7" +files = [ + {file = "dataclasses-0.8-py3-none-any.whl", hash = "sha256:0201d89fa866f68c8ebd9d08ee6ff50c0b255f8ec63a71c16fda7af82bb887bf"}, + {file = "dataclasses-0.8.tar.gz", hash = "sha256:8479067f342acf957dc82ec415d355ab5edb7e7646b90dc6e2fd1d96ad084c97"}, +] + +[[package]] +name = "greenlet" +version = "2.0.2" +description = "Lightweight in-process concurrent programming" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" +files = [ + {file = "greenlet-2.0.2-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:bdfea8c661e80d3c1c99ad7c3ff74e6e87184895bbaca6ee8cc61209f8b9b85d"}, + {file = "greenlet-2.0.2-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:9d14b83fab60d5e8abe587d51c75b252bcc21683f24699ada8fb275d7712f5a9"}, + {file = "greenlet-2.0.2-cp27-cp27m-win32.whl", hash = "sha256:6c3acb79b0bfd4fe733dff8bc62695283b57949ebcca05ae5c129eb606ff2d74"}, + {file = "greenlet-2.0.2-cp27-cp27m-win_amd64.whl", hash = "sha256:283737e0da3f08bd637b5ad058507e578dd462db259f7f6e4c5c365ba4ee9343"}, + {file = "greenlet-2.0.2-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:d27ec7509b9c18b6d73f2f5ede2622441de812e7b1a80bbd446cb0633bd3d5ae"}, + {file = "greenlet-2.0.2-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:30bcf80dda7f15ac77ba5af2b961bdd9dbc77fd4ac6105cee85b0d0a5fcf74df"}, + {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:26fbfce90728d82bc9e6c38ea4d038cba20b7faf8a0ca53a9c07b67318d46088"}, + {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9190f09060ea4debddd24665d6804b995a9c122ef5917ab26e1566dcc712ceeb"}, + {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d75209eed723105f9596807495d58d10b3470fa6732dd6756595e89925ce2470"}, + {file = "greenlet-2.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3a51c9751078733d88e013587b108f1b7a1fb106d402fb390740f002b6f6551a"}, + {file = "greenlet-2.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:76ae285c8104046b3a7f06b42f29c7b73f77683df18c49ab5af7983994c2dd91"}, + {file = "greenlet-2.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:2d4686f195e32d36b4d7cf2d166857dbd0ee9f3d20ae349b6bf8afc8485b3645"}, + {file = "greenlet-2.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c4302695ad8027363e96311df24ee28978162cdcdd2006476c43970b384a244c"}, + {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c48f54ef8e05f04d6eff74b8233f6063cb1ed960243eacc474ee73a2ea8573ca"}, + {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a1846f1b999e78e13837c93c778dcfc3365902cfb8d1bdb7dd73ead37059f0d0"}, + {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a06ad5312349fec0ab944664b01d26f8d1f05009566339ac6f63f56589bc1a2"}, + {file = "greenlet-2.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:eff4eb9b7eb3e4d0cae3d28c283dc16d9bed6b193c2e1ace3ed86ce48ea8df19"}, + {file = "greenlet-2.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5454276c07d27a740c5892f4907c86327b632127dd9abec42ee62e12427ff7e3"}, + {file = "greenlet-2.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:7cafd1208fdbe93b67c7086876f061f660cfddc44f404279c1585bbf3cdc64c5"}, + {file = "greenlet-2.0.2-cp35-cp35m-macosx_10_14_x86_64.whl", hash = "sha256:910841381caba4f744a44bf81bfd573c94e10b3045ee00de0cbf436fe50673a6"}, + {file = "greenlet-2.0.2-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:18a7f18b82b52ee85322d7a7874e676f34ab319b9f8cce5de06067384aa8ff43"}, + {file = "greenlet-2.0.2-cp35-cp35m-win32.whl", hash = "sha256:03a8f4f3430c3b3ff8d10a2a86028c660355ab637cee9333d63d66b56f09d52a"}, + {file = "greenlet-2.0.2-cp35-cp35m-win_amd64.whl", hash = "sha256:4b58adb399c4d61d912c4c331984d60eb66565175cdf4a34792cd9600f21b394"}, + {file = "greenlet-2.0.2-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:703f18f3fda276b9a916f0934d2fb6d989bf0b4fb5a64825260eb9bfd52d78f0"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:32e5b64b148966d9cccc2c8d35a671409e45f195864560829f395a54226408d3"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2dd11f291565a81d71dab10b7033395b7a3a5456e637cf997a6f33ebdf06f8db"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e0f72c9ddb8cd28532185f54cc1453f2c16fb417a08b53a855c4e6a418edd099"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cd021c754b162c0fb55ad5d6b9d960db667faad0fa2ff25bb6e1301b0b6e6a75"}, + {file = "greenlet-2.0.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:3c9b12575734155d0c09d6c3e10dbd81665d5c18e1a7c6597df72fd05990c8cf"}, + {file = "greenlet-2.0.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:b9ec052b06a0524f0e35bd8790686a1da006bd911dd1ef7d50b77bfbad74e292"}, + {file = "greenlet-2.0.2-cp36-cp36m-win32.whl", hash = "sha256:dbfcfc0218093a19c252ca8eb9aee3d29cfdcb586df21049b9d777fd32c14fd9"}, + {file = "greenlet-2.0.2-cp36-cp36m-win_amd64.whl", hash = "sha256:9f35ec95538f50292f6d8f2c9c9f8a3c6540bbfec21c9e5b4b751e0a7c20864f"}, + {file = "greenlet-2.0.2-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:d5508f0b173e6aa47273bdc0a0b5ba055b59662ba7c7ee5119528f466585526b"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:f82d4d717d8ef19188687aa32b8363e96062911e63ba22a0cff7802a8e58e5f1"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9c59a2120b55788e800d82dfa99b9e156ff8f2227f07c5e3012a45a399620b7"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2780572ec463d44c1d3ae850239508dbeb9fed38e294c68d19a24d925d9223ca"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:937e9020b514ceedb9c830c55d5c9872abc90f4b5862f89c0887033ae33c6f73"}, + {file = "greenlet-2.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:36abbf031e1c0f79dd5d596bfaf8e921c41df2bdf54ee1eed921ce1f52999a86"}, + {file = "greenlet-2.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:18e98fb3de7dba1c0a852731c3070cf022d14f0d68b4c87a19cc1016f3bb8b33"}, + {file = "greenlet-2.0.2-cp37-cp37m-win32.whl", hash = "sha256:3f6ea9bd35eb450837a3d80e77b517ea5bc56b4647f5502cd28de13675ee12f7"}, + {file = "greenlet-2.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:7492e2b7bd7c9b9916388d9df23fa49d9b88ac0640db0a5b4ecc2b653bf451e3"}, + {file = "greenlet-2.0.2-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:b864ba53912b6c3ab6bcb2beb19f19edd01a6bfcbdfe1f37ddd1778abfe75a30"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:ba2956617f1c42598a308a84c6cf021a90ff3862eddafd20c3333d50f0edb45b"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc3a569657468b6f3fb60587e48356fe512c1754ca05a564f11366ac9e306526"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8eab883b3b2a38cc1e050819ef06a7e6344d4a990d24d45bc6f2cf959045a45b"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acd2162a36d3de67ee896c43effcd5ee3de247eb00354db411feb025aa319857"}, + {file = "greenlet-2.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:0bf60faf0bc2468089bdc5edd10555bab6e85152191df713e2ab1fcc86382b5a"}, + {file = "greenlet-2.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b0ef99cdbe2b682b9ccbb964743a6aca37905fda5e0452e5ee239b1654d37f2a"}, + {file = "greenlet-2.0.2-cp38-cp38-win32.whl", hash = "sha256:b80f600eddddce72320dbbc8e3784d16bd3fb7b517e82476d8da921f27d4b249"}, + {file = "greenlet-2.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:4d2e11331fc0c02b6e84b0d28ece3a36e0548ee1a1ce9ddde03752d9b79bba40"}, + {file = "greenlet-2.0.2-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:88d9ab96491d38a5ab7c56dd7a3cc37d83336ecc564e4e8816dbed12e5aaefc8"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:561091a7be172ab497a3527602d467e2b3fbe75f9e783d8b8ce403fa414f71a6"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:971ce5e14dc5e73715755d0ca2975ac88cfdaefcaab078a284fea6cfabf866df"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be4ed120b52ae4d974aa40215fcdfde9194d63541c7ded40ee12eb4dda57b76b"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94c817e84245513926588caf1152e3b559ff794d505555211ca041f032abbb6b"}, + {file = "greenlet-2.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1a819eef4b0e0b96bb0d98d797bef17dc1b4a10e8d7446be32d1da33e095dbb8"}, + {file = "greenlet-2.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7efde645ca1cc441d6dc4b48c0f7101e8d86b54c8530141b09fd31cef5149ec9"}, + {file = "greenlet-2.0.2-cp39-cp39-win32.whl", hash = "sha256:ea9872c80c132f4663822dd2a08d404073a5a9b5ba6155bea72fb2a79d1093b5"}, + {file = "greenlet-2.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:db1a39669102a1d8d12b57de2bb7e2ec9066a6f2b3da35ae511ff93b01b5d564"}, + {file = "greenlet-2.0.2.tar.gz", hash = "sha256:e7c8dc13af7db097bed64a051d2dd49e9f0af495c26995c00a9ee842690d34c0"}, +] + +[package.extras] +docs = ["Sphinx", "docutils (<0.18)"] +test = ["objgraph", "psutil"] + +[[package]] +name = "idna" +version = "3.4" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, + {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, +] + +[[package]] +name = "importlib-metadata" +version = "6.7.0" +description = "Read metadata from Python packages" +optional = false +python-versions = ">=3.7" +files = [ + {file = "importlib_metadata-6.7.0-py3-none-any.whl", hash = "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5"}, + {file = "importlib_metadata-6.7.0.tar.gz", hash = "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4"}, +] + +[package.dependencies] +typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} +zipp = ">=0.5" + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +perf = ["ipython"] +testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "iso8601" +version = "1.0.2" +description = "Simple module to parse ISO 8601 dates" +optional = false +python-versions = ">=3.6.2,<4.0" +files = [ + {file = "iso8601-1.0.2-py3-none-any.whl", hash = "sha256:d7bc01b1c2a43b259570bb307f057abc578786ea734ba2b87b836c5efc5bd443"}, + {file = "iso8601-1.0.2.tar.gz", hash = "sha256:27f503220e6845d9db954fb212b95b0362d8b7e6c1b2326a87061c3de93594b1"}, +] + +[[package]] +name = "mypy" +version = "0.910" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy-0.910-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:a155d80ea6cee511a3694b108c4494a39f42de11ee4e61e72bc424c490e46457"}, + {file = "mypy-0.910-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:b94e4b785e304a04ea0828759172a15add27088520dc7e49ceade7834275bedb"}, + {file = "mypy-0.910-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:088cd9c7904b4ad80bec811053272986611b84221835e079be5bcad029e79dd9"}, + {file = "mypy-0.910-cp35-cp35m-win_amd64.whl", hash = "sha256:adaeee09bfde366d2c13fe6093a7df5df83c9a2ba98638c7d76b010694db760e"}, + {file = "mypy-0.910-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ecd2c3fe726758037234c93df7e98deb257fd15c24c9180dacf1ef829da5f921"}, + {file = "mypy-0.910-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:d9dd839eb0dc1bbe866a288ba3c1afc33a202015d2ad83b31e875b5905a079b6"}, + {file = "mypy-0.910-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:3e382b29f8e0ccf19a2df2b29a167591245df90c0b5a2542249873b5c1d78212"}, + {file = "mypy-0.910-cp36-cp36m-win_amd64.whl", hash = "sha256:53fd2eb27a8ee2892614370896956af2ff61254c275aaee4c230ae771cadd885"}, + {file = "mypy-0.910-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b6fb13123aeef4a3abbcfd7e71773ff3ff1526a7d3dc538f3929a49b42be03f0"}, + {file = "mypy-0.910-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e4dab234478e3bd3ce83bac4193b2ecd9cf94e720ddd95ce69840273bf44f6de"}, + {file = "mypy-0.910-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:7df1ead20c81371ccd6091fa3e2878559b5c4d4caadaf1a484cf88d93ca06703"}, + {file = "mypy-0.910-cp37-cp37m-win_amd64.whl", hash = "sha256:0aadfb2d3935988ec3815952e44058a3100499f5be5b28c34ac9d79f002a4a9a"}, + {file = "mypy-0.910-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ec4e0cd079db280b6bdabdc807047ff3e199f334050db5cbb91ba3e959a67504"}, + {file = "mypy-0.910-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:119bed3832d961f3a880787bf621634ba042cb8dc850a7429f643508eeac97b9"}, + {file = "mypy-0.910-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:866c41f28cee548475f146aa4d39a51cf3b6a84246969f3759cb3e9c742fc072"}, + {file = "mypy-0.910-cp38-cp38-win_amd64.whl", hash = "sha256:ceb6e0a6e27fb364fb3853389607cf7eb3a126ad335790fa1e14ed02fba50811"}, + {file = "mypy-0.910-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1a85e280d4d217150ce8cb1a6dddffd14e753a4e0c3cf90baabb32cefa41b59e"}, + {file = "mypy-0.910-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:42c266ced41b65ed40a282c575705325fa7991af370036d3f134518336636f5b"}, + {file = "mypy-0.910-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:3c4b8ca36877fc75339253721f69603a9c7fdb5d4d5a95a1a1b899d8b86a4de2"}, + {file = "mypy-0.910-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:c0df2d30ed496a08de5daed2a9ea807d07c21ae0ab23acf541ab88c24b26ab97"}, + {file = "mypy-0.910-cp39-cp39-win_amd64.whl", hash = "sha256:c6c2602dffb74867498f86e6129fd52a2770c48b7cd3ece77ada4fa38f94eba8"}, + {file = "mypy-0.910-py3-none-any.whl", hash = "sha256:ef565033fa5a958e62796867b1df10c40263ea9ded87164d67572834e57a174d"}, + {file = "mypy-0.910.tar.gz", hash = "sha256:704098302473cb31a218f1775a873b376b30b4c18229421e9e9dc8916fd16150"}, +] + +[package.dependencies] +mypy-extensions = ">=0.4.3,<0.5.0" +toml = "*" +typed-ast = {version = ">=1.4.0,<1.5.0", markers = "python_version < \"3.8\""} +typing-extensions = ">=3.7.4" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +python2 = ["typed-ast (>=1.4.0,<1.5.0)"] + +[[package]] +name = "mypy-extensions" +version = "0.4.4" +description = "Experimental type system extensions for programs checked with the mypy typechecker." +optional = false +python-versions = ">=2.7" +files = [ + {file = "mypy_extensions-0.4.4.tar.gz", hash = "sha256:c8b707883a96efe9b4bb3aaf0dcc07e7e217d7d8368eec4db4049ee9e142f4fd"}, +] + +[[package]] +name = "numpy" +version = "1.24.4" +description = "Fundamental package for array computing in Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "numpy-1.24.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c0bfb52d2169d58c1cdb8cc1f16989101639b34c7d3ce60ed70b19c63eba0b64"}, + {file = "numpy-1.24.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ed094d4f0c177b1b8e7aa9cba7d6ceed51c0e569a5318ac0ca9a090680a6a1b1"}, + {file = "numpy-1.24.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79fc682a374c4a8ed08b331bef9c5f582585d1048fa6d80bc6c35bc384eee9b4"}, + {file = "numpy-1.24.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ffe43c74893dbf38c2b0a1f5428760a1a9c98285553c89e12d70a96a7f3a4d6"}, + {file = "numpy-1.24.4-cp310-cp310-win32.whl", hash = "sha256:4c21decb6ea94057331e111a5bed9a79d335658c27ce2adb580fb4d54f2ad9bc"}, + {file = "numpy-1.24.4-cp310-cp310-win_amd64.whl", hash = "sha256:b4bea75e47d9586d31e892a7401f76e909712a0fd510f58f5337bea9572c571e"}, + {file = "numpy-1.24.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f136bab9c2cfd8da131132c2cf6cc27331dd6fae65f95f69dcd4ae3c3639c810"}, + {file = "numpy-1.24.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e2926dac25b313635e4d6cf4dc4e51c8c0ebfed60b801c799ffc4c32bf3d1254"}, + {file = "numpy-1.24.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:222e40d0e2548690405b0b3c7b21d1169117391c2e82c378467ef9ab4c8f0da7"}, + {file = "numpy-1.24.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7215847ce88a85ce39baf9e89070cb860c98fdddacbaa6c0da3ffb31b3350bd5"}, + {file = "numpy-1.24.4-cp311-cp311-win32.whl", hash = "sha256:4979217d7de511a8d57f4b4b5b2b965f707768440c17cb70fbf254c4b225238d"}, + {file = "numpy-1.24.4-cp311-cp311-win_amd64.whl", hash = "sha256:b7b1fc9864d7d39e28f41d089bfd6353cb5f27ecd9905348c24187a768c79694"}, + {file = "numpy-1.24.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1452241c290f3e2a312c137a9999cdbf63f78864d63c79039bda65ee86943f61"}, + {file = "numpy-1.24.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:04640dab83f7c6c85abf9cd729c5b65f1ebd0ccf9de90b270cd61935eef0197f"}, + {file = "numpy-1.24.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5425b114831d1e77e4b5d812b69d11d962e104095a5b9c3b641a218abcc050e"}, + {file = "numpy-1.24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd80e219fd4c71fc3699fc1dadac5dcf4fd882bfc6f7ec53d30fa197b8ee22dc"}, + {file = "numpy-1.24.4-cp38-cp38-win32.whl", hash = "sha256:4602244f345453db537be5314d3983dbf5834a9701b7723ec28923e2889e0bb2"}, + {file = "numpy-1.24.4-cp38-cp38-win_amd64.whl", hash = "sha256:692f2e0f55794943c5bfff12b3f56f99af76f902fc47487bdfe97856de51a706"}, + {file = "numpy-1.24.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2541312fbf09977f3b3ad449c4e5f4bb55d0dbf79226d7724211acc905049400"}, + {file = "numpy-1.24.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9667575fb6d13c95f1b36aca12c5ee3356bf001b714fc354eb5465ce1609e62f"}, + {file = "numpy-1.24.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3a86ed21e4f87050382c7bc96571755193c4c1392490744ac73d660e8f564a9"}, + {file = "numpy-1.24.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d11efb4dbecbdf22508d55e48d9c8384db795e1b7b51ea735289ff96613ff74d"}, + {file = "numpy-1.24.4-cp39-cp39-win32.whl", hash = "sha256:6620c0acd41dbcb368610bb2f4d83145674040025e5536954782467100aa8835"}, + {file = "numpy-1.24.4-cp39-cp39-win_amd64.whl", hash = "sha256:befe2bf740fd8373cf56149a5c23a0f601e82869598d41f8e188a0e9869926f8"}, + {file = "numpy-1.24.4-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:31f13e25b4e304632a4619d0e0777662c2ffea99fcae2029556b17d8ff958aef"}, + {file = "numpy-1.24.4-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95f7ac6540e95bc440ad77f56e520da5bf877f87dca58bd095288dce8940532a"}, + {file = "numpy-1.24.4-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e98f220aa76ca2a977fe435f5b04d7b3470c0a2e6312907b37ba6068f26787f2"}, + {file = "numpy-1.24.4.tar.gz", hash = "sha256:80f5e3a4e498641401868df4208b74581206afbee7cf7b8329daae82676d9463"}, +] + +[[package]] +name = "numpy" +version = "1.25.2" +description = "Fundamental package for array computing in Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "numpy-1.25.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:db3ccc4e37a6873045580d413fe79b68e47a681af8db2e046f1dacfa11f86eb3"}, + {file = "numpy-1.25.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:90319e4f002795ccfc9050110bbbaa16c944b1c37c0baeea43c5fb881693ae1f"}, + {file = "numpy-1.25.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfe4a913e29b418d096e696ddd422d8a5d13ffba4ea91f9f60440a3b759b0187"}, + {file = "numpy-1.25.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f08f2e037bba04e707eebf4bc934f1972a315c883a9e0ebfa8a7756eabf9e357"}, + {file = "numpy-1.25.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bec1e7213c7cb00d67093247f8c4db156fd03075f49876957dca4711306d39c9"}, + {file = "numpy-1.25.2-cp310-cp310-win32.whl", hash = "sha256:7dc869c0c75988e1c693d0e2d5b26034644399dd929bc049db55395b1379e044"}, + {file = "numpy-1.25.2-cp310-cp310-win_amd64.whl", hash = "sha256:834b386f2b8210dca38c71a6e0f4fd6922f7d3fcff935dbe3a570945acb1b545"}, + {file = "numpy-1.25.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c5462d19336db4560041517dbb7759c21d181a67cb01b36ca109b2ae37d32418"}, + {file = "numpy-1.25.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5652ea24d33585ea39eb6a6a15dac87a1206a692719ff45d53c5282e66d4a8f"}, + {file = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2"}, + {file = "numpy-1.25.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:60e7f0f7f6d0eee8364b9a6304c2845b9c491ac706048c7e8cf47b83123b8dbf"}, + {file = "numpy-1.25.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bb33d5a1cf360304754913a350edda36d5b8c5331a8237268c48f91253c3a364"}, + {file = "numpy-1.25.2-cp311-cp311-win32.whl", hash = "sha256:5883c06bb92f2e6c8181df7b39971a5fb436288db58b5a1c3967702d4278691d"}, + {file = "numpy-1.25.2-cp311-cp311-win_amd64.whl", hash = "sha256:5c97325a0ba6f9d041feb9390924614b60b99209a71a69c876f71052521d42a4"}, + {file = "numpy-1.25.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b79e513d7aac42ae918db3ad1341a015488530d0bb2a6abcbdd10a3a829ccfd3"}, + {file = "numpy-1.25.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:eb942bfb6f84df5ce05dbf4b46673ffed0d3da59f13635ea9b926af3deb76926"}, + {file = "numpy-1.25.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e0746410e73384e70d286f93abf2520035250aad8c5714240b0492a7302fdca"}, + {file = "numpy-1.25.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7806500e4f5bdd04095e849265e55de20d8cc4b661b038957354327f6d9b295"}, + {file = "numpy-1.25.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8b77775f4b7df768967a7c8b3567e309f617dd5e99aeb886fa14dc1a0791141f"}, + {file = "numpy-1.25.2-cp39-cp39-win32.whl", hash = "sha256:2792d23d62ec51e50ce4d4b7d73de8f67a2fd3ea710dcbc8563a51a03fb07b01"}, + {file = "numpy-1.25.2-cp39-cp39-win_amd64.whl", hash = "sha256:76b4115d42a7dfc5d485d358728cdd8719be33cc5ec6ec08632a5d6fca2ed380"}, + {file = "numpy-1.25.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:1a1329e26f46230bf77b02cc19e900db9b52f398d6722ca853349a782d4cff55"}, + {file = "numpy-1.25.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c3abc71e8b6edba80a01a52e66d83c5d14433cbcd26a40c329ec7ed09f37901"}, + {file = "numpy-1.25.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:1b9735c27cea5d995496f46a8b1cd7b408b3f34b6d50459d9ac8fe3a20cc17bf"}, + {file = "numpy-1.25.2.tar.gz", hash = "sha256:fd608e19c8d7c55021dffd43bfe5492fab8cc105cc8986f813f8c3c048b38760"}, +] + +[[package]] +name = "packaging" +version = "23.1" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.7" +files = [ + {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, + {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, +] + +[[package]] +name = "pandas" +version = "2.0.3" +description = "Powerful data structures for data analysis, time series, and statistics" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pandas-2.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e4c7c9f27a4185304c7caf96dc7d91bc60bc162221152de697c98eb0b2648dd8"}, + {file = "pandas-2.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f167beed68918d62bffb6ec64f2e1d8a7d297a038f86d4aed056b9493fca407f"}, + {file = "pandas-2.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce0c6f76a0f1ba361551f3e6dceaff06bde7514a374aa43e33b588ec10420183"}, + {file = "pandas-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba619e410a21d8c387a1ea6e8a0e49bb42216474436245718d7f2e88a2f8d7c0"}, + {file = "pandas-2.0.3-cp310-cp310-win32.whl", hash = "sha256:3ef285093b4fe5058eefd756100a367f27029913760773c8bf1d2d8bebe5d210"}, + {file = "pandas-2.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:9ee1a69328d5c36c98d8e74db06f4ad518a1840e8ccb94a4ba86920986bb617e"}, + {file = "pandas-2.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b084b91d8d66ab19f5bb3256cbd5ea661848338301940e17f4492b2ce0801fe8"}, + {file = "pandas-2.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:37673e3bdf1551b95bf5d4ce372b37770f9529743d2498032439371fc7b7eb26"}, + {file = "pandas-2.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b9cb1e14fdb546396b7e1b923ffaeeac24e4cedd14266c3497216dd4448e4f2d"}, + {file = "pandas-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d9cd88488cceb7635aebb84809d087468eb33551097d600c6dad13602029c2df"}, + {file = "pandas-2.0.3-cp311-cp311-win32.whl", hash = "sha256:694888a81198786f0e164ee3a581df7d505024fbb1f15202fc7db88a71d84ebd"}, + {file = "pandas-2.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:6a21ab5c89dcbd57f78d0ae16630b090eec626360085a4148693def5452d8a6b"}, + {file = "pandas-2.0.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9e4da0d45e7f34c069fe4d522359df7d23badf83abc1d1cef398895822d11061"}, + {file = "pandas-2.0.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:32fca2ee1b0d93dd71d979726b12b61faa06aeb93cf77468776287f41ff8fdc5"}, + {file = "pandas-2.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:258d3624b3ae734490e4d63c430256e716f488c4fcb7c8e9bde2d3aa46c29089"}, + {file = "pandas-2.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9eae3dc34fa1aa7772dd3fc60270d13ced7346fcbcfee017d3132ec625e23bb0"}, + {file = "pandas-2.0.3-cp38-cp38-win32.whl", hash = "sha256:f3421a7afb1a43f7e38e82e844e2bca9a6d793d66c1a7f9f0ff39a795bbc5e02"}, + {file = "pandas-2.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:69d7f3884c95da3a31ef82b7618af5710dba95bb885ffab339aad925c3e8ce78"}, + {file = "pandas-2.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5247fb1ba347c1261cbbf0fcfba4a3121fbb4029d95d9ef4dc45406620b25c8b"}, + {file = "pandas-2.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:81af086f4543c9d8bb128328b5d32e9986e0c84d3ee673a2ac6fb57fd14f755e"}, + {file = "pandas-2.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1994c789bf12a7c5098277fb43836ce090f1073858c10f9220998ac74f37c69b"}, + {file = "pandas-2.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ec591c48e29226bcbb316e0c1e9423622bc7a4eaf1ef7c3c9fa1a3981f89641"}, + {file = "pandas-2.0.3-cp39-cp39-win32.whl", hash = "sha256:04dbdbaf2e4d46ca8da896e1805bc04eb85caa9a82e259e8eed00254d5e0c682"}, + {file = "pandas-2.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:1168574b036cd8b93abc746171c9b4f1b83467438a5e45909fed645cf8692dbc"}, + {file = "pandas-2.0.3.tar.gz", hash = "sha256:c02f372a88e0d17f36d3093a644c73cfc1788e876a7c4bcb4020a77512e2043c"}, +] + +[package.dependencies] +numpy = [ + {version = ">=1.20.3", markers = "python_version < \"3.10\""}, + {version = ">=1.21.0", markers = "python_version >= \"3.10\""}, + {version = ">=1.23.2", markers = "python_version >= \"3.11\""}, +] +python-dateutil = ">=2.8.2" +pytz = ">=2020.1" +tzdata = ">=2022.1" + +[package.extras] +all = ["PyQt5 (>=5.15.1)", "SQLAlchemy (>=1.4.16)", "beautifulsoup4 (>=4.9.3)", "bottleneck (>=1.3.2)", "brotlipy (>=0.7.0)", "fastparquet (>=0.6.3)", "fsspec (>=2021.07.0)", "gcsfs (>=2021.07.0)", "html5lib (>=1.1)", "hypothesis (>=6.34.2)", "jinja2 (>=3.0.0)", "lxml (>=4.6.3)", "matplotlib (>=3.6.1)", "numba (>=0.53.1)", "numexpr (>=2.7.3)", "odfpy (>=1.4.1)", "openpyxl (>=3.0.7)", "pandas-gbq (>=0.15.0)", "psycopg2 (>=2.8.6)", "pyarrow (>=7.0.0)", "pymysql (>=1.0.2)", "pyreadstat (>=1.1.2)", "pytest (>=7.3.2)", "pytest-asyncio (>=0.17.0)", "pytest-xdist (>=2.2.0)", "python-snappy (>=0.6.0)", "pyxlsb (>=1.0.8)", "qtpy (>=2.2.0)", "s3fs (>=2021.08.0)", "scipy (>=1.7.1)", "tables (>=3.6.1)", "tabulate (>=0.8.9)", "xarray (>=0.21.0)", "xlrd (>=2.0.1)", "xlsxwriter (>=1.4.3)", "zstandard (>=0.15.2)"] +aws = ["s3fs (>=2021.08.0)"] +clipboard = ["PyQt5 (>=5.15.1)", "qtpy (>=2.2.0)"] +compression = ["brotlipy (>=0.7.0)", "python-snappy (>=0.6.0)", "zstandard (>=0.15.2)"] +computation = ["scipy (>=1.7.1)", "xarray (>=0.21.0)"] +excel = ["odfpy (>=1.4.1)", "openpyxl (>=3.0.7)", "pyxlsb (>=1.0.8)", "xlrd (>=2.0.1)", "xlsxwriter (>=1.4.3)"] +feather = ["pyarrow (>=7.0.0)"] +fss = ["fsspec (>=2021.07.0)"] +gcp = ["gcsfs (>=2021.07.0)", "pandas-gbq (>=0.15.0)"] +hdf5 = ["tables (>=3.6.1)"] +html = ["beautifulsoup4 (>=4.9.3)", "html5lib (>=1.1)", "lxml (>=4.6.3)"] +mysql = ["SQLAlchemy (>=1.4.16)", "pymysql (>=1.0.2)"] +output-formatting = ["jinja2 (>=3.0.0)", "tabulate (>=0.8.9)"] +parquet = ["pyarrow (>=7.0.0)"] +performance = ["bottleneck (>=1.3.2)", "numba (>=0.53.1)", "numexpr (>=2.7.1)"] +plot = ["matplotlib (>=3.6.1)"] +postgresql = ["SQLAlchemy (>=1.4.16)", "psycopg2 (>=2.8.6)"] +spss = ["pyreadstat (>=1.1.2)"] +sql-other = ["SQLAlchemy (>=1.4.16)"] +test = ["hypothesis (>=6.34.2)", "pytest (>=7.3.2)", "pytest-asyncio (>=0.17.0)", "pytest-xdist (>=2.2.0)"] +xml = ["lxml (>=4.6.3)"] + +[[package]] +name = "pathspec" +version = "0.9.0" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +files = [ + {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, + {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, +] + +[[package]] +name = "platformdirs" +version = "2.4.0" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +optional = false +python-versions = ">=3.6" +files = [ + {file = "platformdirs-2.4.0-py3-none-any.whl", hash = "sha256:8868bbe3c3c80d42f20156f22e7131d2fb321f5bc86a2a345375c6481a67021d"}, + {file = "platformdirs-2.4.0.tar.gz", hash = "sha256:367a5e80b3d04d2428ffa76d33f124cf11e8fff2acdaa9b43d545f5c7d661ef2"}, +] + +[package.extras] +docs = ["Sphinx (>=4)", "furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)"] +test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"] + +[[package]] +name = "pluggy" +version = "1.2.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, + {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, +] + +[package.dependencies] +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "py" +version = "1.11.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, + {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, +] + +[[package]] +name = "pytest" +version = "6.2.5" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, + {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, +] + +[package.dependencies] +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} +attrs = ">=19.2.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +py = ">=1.8.2" +toml = "*" + +[package.extras] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] + +[[package]] +name = "pytest-cov" +version = "4.0.0" +description = "Pytest plugin for measuring coverage." +optional = false +python-versions = ">=3.6" +files = [ + {file = "pytest-cov-4.0.0.tar.gz", hash = "sha256:996b79efde6433cdbd0088872dbc5fb3ed7fe1578b68cdbba634f14bb8dd0470"}, + {file = "pytest_cov-4.0.0-py3-none-any.whl", hash = "sha256:2feb1b751d66a8bd934e5edfa2e961d11309dc37b73b0eabe73b5945fee20f6b"}, +] + +[package.dependencies] +coverage = {version = ">=5.2.1", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] + +[[package]] +name = "python-dateutil" +version = "2.8.2" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, + {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "python-dotenv" +version = "0.20.0" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.5" +files = [ + {file = "python-dotenv-0.20.0.tar.gz", hash = "sha256:b7e3b04a59693c42c36f9ab1cc2acc46fa5df8c78e178fc33a8d4cd05c8d498f"}, + {file = "python_dotenv-0.20.0-py3-none-any.whl", hash = "sha256:d92a187be61fe482e4fd675b6d52200e7be63a12b724abbf931a40ce4fa92938"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + +[[package]] +name = "pytz" +version = "2023.3" +description = "World timezone definitions, modern and historical" +optional = false +python-versions = "*" +files = [ + {file = "pytz-2023.3-py2.py3-none-any.whl", hash = "sha256:a151b3abb88eda1d4e34a9814df37de2a80e301e68ba0fd856fb9b46bfbbbffb"}, + {file = "pytz-2023.3.tar.gz", hash = "sha256:1d8ce29db189191fb55338ee6d0387d82ab59f3d00eac103412d64e0ebd0c588"}, +] + +[[package]] +name = "requests" +version = "2.27.1" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +files = [ + {file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"}, + {file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = {version = ">=2.0.0,<2.1.0", markers = "python_version >= \"3\""} +idna = {version = ">=2.5,<4", markers = "python_version >= \"3\""} +urllib3 = ">=1.21.1,<1.27" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<5)"] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "sqlalchemy" +version = "1.4.49" +description = "Database Abstraction Library" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +files = [ + {file = "SQLAlchemy-1.4.49-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:2e126cf98b7fd38f1e33c64484406b78e937b1a280e078ef558b95bf5b6895f6"}, + {file = "SQLAlchemy-1.4.49-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:03db81b89fe7ef3857b4a00b63dedd632d6183d4ea5a31c5d8a92e000a41fc71"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:95b9df9afd680b7a3b13b38adf6e3a38995da5e162cc7524ef08e3be4e5ed3e1"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a63e43bf3f668c11bb0444ce6e809c1227b8f067ca1068898f3008a273f52b09"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f835c050ebaa4e48b18403bed2c0fda986525896efd76c245bdd4db995e51a4c"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c21b172dfb22e0db303ff6419451f0cac891d2e911bb9fbf8003d717f1bcf91"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-win32.whl", hash = "sha256:5fb1ebdfc8373b5a291485757bd6431de8d7ed42c27439f543c81f6c8febd729"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-win_amd64.whl", hash = "sha256:f8a65990c9c490f4651b5c02abccc9f113a7f56fa482031ac8cb88b70bc8ccaa"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8923dfdf24d5aa8a3adb59723f54118dd4fe62cf59ed0d0d65d940579c1170a4"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9ab2c507a7a439f13ca4499db6d3f50423d1d65dc9b5ed897e70941d9e135b0"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5debe7d49b8acf1f3035317e63d9ec8d5e4d904c6e75a2a9246a119f5f2fdf3d"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-win32.whl", hash = "sha256:82b08e82da3756765c2e75f327b9bf6b0f043c9c3925fb95fb51e1567fa4ee87"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-win_amd64.whl", hash = "sha256:171e04eeb5d1c0d96a544caf982621a1711d078dbc5c96f11d6469169bd003f1"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:36e58f8c4fe43984384e3fbe6341ac99b6b4e083de2fe838f0fdb91cebe9e9cb"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b31e67ff419013f99ad6f8fc73ee19ea31585e1e9fe773744c0f3ce58c039c30"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c14b29d9e1529f99efd550cd04dbb6db6ba5d690abb96d52de2bff4ed518bc95"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c40f3470e084d31247aea228aa1c39bbc0904c2b9ccbf5d3cfa2ea2dac06f26d"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-win32.whl", hash = "sha256:706bfa02157b97c136547c406f263e4c6274a7b061b3eb9742915dd774bbc264"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-win_amd64.whl", hash = "sha256:a7f7b5c07ae5c0cfd24c2db86071fb2a3d947da7bd487e359cc91e67ac1c6d2e"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-macosx_11_0_x86_64.whl", hash = "sha256:4afbbf5ef41ac18e02c8dc1f86c04b22b7a2125f2a030e25bbb4aff31abb224b"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:24e300c0c2147484a002b175f4e1361f102e82c345bf263242f0449672a4bccf"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:201de072b818f8ad55c80d18d1a788729cccf9be6d9dc3b9d8613b053cd4836d"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7653ed6817c710d0c95558232aba799307d14ae084cc9b1f4c389157ec50df5c"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-win32.whl", hash = "sha256:647e0b309cb4512b1f1b78471fdaf72921b6fa6e750b9f891e09c6e2f0e5326f"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-win_amd64.whl", hash = "sha256:ab73ed1a05ff539afc4a7f8cf371764cdf79768ecb7d2ec691e3ff89abbc541e"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:37ce517c011560d68f1ffb28af65d7e06f873f191eb3a73af5671e9c3fada08a"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1878ce508edea4a879015ab5215546c444233881301e97ca16fe251e89f1c55"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0e8e608983e6f85d0852ca61f97e521b62e67969e6e640fe6c6b575d4db68557"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ccf956da45290df6e809ea12c54c02ace7f8ff4d765d6d3dfb3655ee876ce58d"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-win32.whl", hash = "sha256:f167c8175ab908ce48bd6550679cc6ea20ae169379e73c7720a28f89e53aa532"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-win_amd64.whl", hash = "sha256:45806315aae81a0c202752558f0df52b42d11dd7ba0097bf71e253b4215f34f4"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:b6d0c4b15d65087738a6e22e0ff461b407533ff65a73b818089efc8eb2b3e1de"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a843e34abfd4c797018fd8d00ffffa99fd5184c421f190b6ca99def4087689bd"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1c890421651b45a681181301b3497e4d57c0d01dc001e10438a40e9a9c25ee77"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d26f280b8f0a8f497bc10573849ad6dc62e671d2468826e5c748d04ed9e670d5"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-win32.whl", hash = "sha256:ec2268de67f73b43320383947e74700e95c6770d0c68c4e615e9897e46296294"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-win_amd64.whl", hash = "sha256:bbdf16372859b8ed3f4d05f925a984771cd2abd18bd187042f24be4886c2a15f"}, + {file = "SQLAlchemy-1.4.49.tar.gz", hash = "sha256:06ff25cbae30c396c4b7737464f2a7fc37a67b7da409993b182b024cec80aed9"}, +] + +[package.dependencies] +greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"win32\" or platform_machine == \"WIN32\" or platform_machine == \"AMD64\" or platform_machine == \"amd64\" or platform_machine == \"x86_64\" or platform_machine == \"ppc64le\" or platform_machine == \"aarch64\")"} +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} + +[package.extras] +aiomysql = ["aiomysql", "greenlet (!=0.4.17)"] +aiosqlite = ["aiosqlite", "greenlet (!=0.4.17)", "typing-extensions (!=3.10.0.1)"] +asyncio = ["greenlet (!=0.4.17)"] +asyncmy = ["asyncmy (>=0.2.3,!=0.2.4)", "greenlet (!=0.4.17)"] +mariadb-connector = ["mariadb (>=1.0.1,!=1.1.2)"] +mssql = ["pyodbc"] +mssql-pymssql = ["pymssql"] +mssql-pyodbc = ["pyodbc"] +mypy = ["mypy (>=0.910)", "sqlalchemy2-stubs"] +mysql = ["mysqlclient (>=1.4.0)", "mysqlclient (>=1.4.0,<2)"] +mysql-connector = ["mysql-connector-python"] +oracle = ["cx-oracle (>=7)", "cx-oracle (>=7,<8)"] +postgresql = ["psycopg2 (>=2.7)"] +postgresql-asyncpg = ["asyncpg", "greenlet (!=0.4.17)"] +postgresql-pg8000 = ["pg8000 (>=1.16.6,!=1.29.0)"] +postgresql-psycopg2binary = ["psycopg2-binary"] +postgresql-psycopg2cffi = ["psycopg2cffi"] +pymysql = ["pymysql", "pymysql (<1)"] +sqlcipher = ["sqlcipher3-binary"] + +[[package]] +name = "taos-ws-py" +version = "0.2.5" +description = "" +optional = true +python-versions = "*" +files = [ + {file = "taos_ws_py-0.2.5-cp37-abi3-macosx_10_7_x86_64.whl", hash = "sha256:30b97412315a85db12cc425bb28c2a5b0780c1f422850600f0bfcf8bcb1b73b7"}, + {file = "taos_ws_py-0.2.5-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:833e1ca622cb06bdb6efb9436cae34dc36b8a3abae7deca5c7725b77b0cbc5cb"}, + {file = "taos_ws_py-0.2.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f75c228082d5047dbc2e24567f40556eedf518a8209fb7d5232c991d78cc5e5"}, + {file = "taos_ws_py-0.2.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:57e84549f6e5104b09f200aafb6eb3c2b109b516e5583f187aa8183e9893d7e0"}, + {file = "taos_ws_py-0.2.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:36c6c5e94e72904b6f0cc97f13d24c27ad85b3556b92fe5140eecf018bc9c723"}, + {file = "taos_ws_py-0.2.5-cp37-abi3-win_amd64.whl", hash = "sha256:f6ddb4c41c476022c2ef5a9d92b9c83e9f81293fc6caa2844e93dfd06c220990"}, +] + +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] + +[[package]] +name = "tomli" +version = "1.2.3" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.6" +files = [ + {file = "tomli-1.2.3-py3-none-any.whl", hash = "sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c"}, + {file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"}, +] + +[[package]] +name = "typed-ast" +version = "1.4.3" +description = "a fork of Python 2 and 3 ast modules with type comment support" +optional = false +python-versions = "*" +files = [ + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9a40cf33902eba6"}, + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:c907f561b1e83e93fad565bac5ba9c22d96a54e7ea0267c708bffe863cbe4075"}, + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux2014_aarch64.whl", hash = "sha256:1b3ead4a96c9101bef08f9f7d1217c096f31667617b58de957f690c92378b528"}, + {file = "typed_ast-1.4.3-cp35-cp35m-win32.whl", hash = "sha256:dde816ca9dac1d9c01dd504ea5967821606f02e510438120091b84e852367428"}, + {file = "typed_ast-1.4.3-cp35-cp35m-win_amd64.whl", hash = "sha256:777a26c84bea6cd934422ac2e3b78863a37017618b6e5c08f92ef69853e765d3"}, + {file = "typed_ast-1.4.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f8afcf15cc511ada719a88e013cec87c11aff7b91f019295eb4530f96fe5ef2f"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:52b1eb8c83f178ab787f3a4283f68258525f8d70f778a2f6dd54d3b5e5fb4341"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:01ae5f73431d21eead5015997ab41afa53aa1fbe252f9da060be5dad2c730ace"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:c190f0899e9f9f8b6b7863debfb739abcb21a5c054f911ca3596d12b8a4c4c7f"}, + {file = "typed_ast-1.4.3-cp36-cp36m-win32.whl", hash = "sha256:398e44cd480f4d2b7ee8d98385ca104e35c81525dd98c519acff1b79bdaac363"}, + {file = "typed_ast-1.4.3-cp36-cp36m-win_amd64.whl", hash = "sha256:bff6ad71c81b3bba8fa35f0f1921fb24ff4476235a6e94a26ada2e54370e6da7"}, + {file = "typed_ast-1.4.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0fb71b8c643187d7492c1f8352f2c15b4c4af3f6338f21681d3681b3dc31a266"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:760ad187b1041a154f0e4d0f6aae3e40fdb51d6de16e5c99aedadd9246450e9e"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5feca99c17af94057417d744607b82dd0a664fd5e4ca98061480fd8b14b18d04"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:95431a26309a21874005845c21118c83991c63ea800dd44843e42a916aec5899"}, + {file = "typed_ast-1.4.3-cp37-cp37m-win32.whl", hash = "sha256:aee0c1256be6c07bd3e1263ff920c325b59849dc95392a05f258bb9b259cf39c"}, + {file = "typed_ast-1.4.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9ad2c92ec681e02baf81fdfa056fe0d818645efa9af1f1cd5fd6f1bd2bdfd805"}, + {file = "typed_ast-1.4.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b36b4f3920103a25e1d5d024d155c504080959582b928e91cb608a65c3a49e1a"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:067a74454df670dcaa4e59349a2e5c81e567d8d65458d480a5b3dfecec08c5ff"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7538e495704e2ccda9b234b82423a4038f324f3a10c43bc088a1636180f11a41"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:af3d4a73793725138d6b334d9d247ce7e5f084d96284ed23f22ee626a7b88e39"}, + {file = "typed_ast-1.4.3-cp38-cp38-win32.whl", hash = "sha256:f2362f3cb0f3172c42938946dbc5b7843c2a28aec307c49100c8b38764eb6927"}, + {file = "typed_ast-1.4.3-cp38-cp38-win_amd64.whl", hash = "sha256:dd4a21253f42b8d2b48410cb31fe501d32f8b9fbeb1f55063ad102fe9c425e40"}, + {file = "typed_ast-1.4.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f328adcfebed9f11301eaedfa48e15bdece9b519fb27e6a8c01aa52a17ec31b3"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:2c726c276d09fc5c414693a2de063f521052d9ea7c240ce553316f70656c84d4"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:cae53c389825d3b46fb37538441f75d6aecc4174f615d048321b716df2757fb0"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:b9574c6f03f685070d859e75c7f9eeca02d6933273b5e69572e5ff9d5e3931c3"}, + {file = "typed_ast-1.4.3-cp39-cp39-win32.whl", hash = "sha256:209596a4ec71d990d71d5e0d312ac935d86930e6eecff6ccc7007fe54d703808"}, + {file = "typed_ast-1.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:9c6d1a54552b5330bc657b7ef0eae25d00ba7ffe85d9ea8ae6540d2197a3788c"}, + {file = "typed_ast-1.4.3.tar.gz", hash = "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65"}, +] + +[[package]] +name = "typing" +version = "3.7.4.3" +description = "Type Hints for Python" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "typing-3.7.4.3-py2-none-any.whl", hash = "sha256:283d868f5071ab9ad873e5e52268d611e851c870a2ba354193026f2dfb29d8b5"}, + {file = "typing-3.7.4.3.tar.gz", hash = "sha256:1187fb9c82fd670d10aa07bbb6cfcfe4bdda42d6fab8d5134f04e8c4d0b71cc9"}, +] + +[[package]] +name = "typing-extensions" +version = "4.1.1" +description = "Backported and Experimental Type Hints for Python 3.6+" +optional = false +python-versions = ">=3.6" +files = [ + {file = "typing_extensions-4.1.1-py3-none-any.whl", hash = "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2"}, + {file = "typing_extensions-4.1.1.tar.gz", hash = "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42"}, +] + +[[package]] +name = "tzdata" +version = "2023.3" +description = "Provider of IANA time zone data" +optional = false +python-versions = ">=2" +files = [ + {file = "tzdata-2023.3-py2.py3-none-any.whl", hash = "sha256:7e65763eef3120314099b6939b5546db7adce1e7d6f2e179e3df563c70511eda"}, + {file = "tzdata-2023.3.tar.gz", hash = "sha256:11ef1e08e54acb0d4f95bdb1be05da659673de4acbd21bf9c69e94cc5e907a3a"}, +] + +[[package]] +name = "urllib3" +version = "1.26.16" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +files = [ + {file = "urllib3-1.26.16-py2.py3-none-any.whl", hash = "sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f"}, + {file = "urllib3-1.26.16.tar.gz", hash = "sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] +secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + +[[package]] +name = "zipp" +version = "3.15.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +optional = false +python-versions = ">=3.7" +files = [ + {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, + {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] + +[extras] +ws = ["taos-ws-py"] + +[metadata] +lock-version = "2.0" +python-versions = ">=3.6.2,<4.0" +content-hash = "b362f9a0f7d50c4f901624e667b3ad2f16050d90343caafc82180b462e23ecf6" diff --git a/taos/_cinterface.c b/taos/_cinterface.c new file mode 100644 index 00000000..8986c207 --- /dev/null +++ b/taos/_cinterface.c @@ -0,0 +1,10569 @@ +/* Generated by Cython 3.0.0 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "C:\\TDengine\\include\\taos.h" + ], + "include_dirs": [ + "C:\\TDengine\\include" + ], + "libraries": [ + "taos" + ], + "library_dirs": [ + "C:\\TDengine\\driver" + ], + "name": "taos._cinterface", + "sources": [ + "taos/_cinterface.pyx" + ] + }, + "module_name": "taos._cinterface" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#define CYTHON_ABI "3_0_0" +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030000F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PY_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject *co=NULL, *result=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(p))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; + if (!(empty = PyTuple_New(0))) goto end; + result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); + end: + Py_XDECREF((PyObject*) co); + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE(obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__taos___cinterface +#define __PYX_HAVE_API__taos___cinterface +/* Early includes */ +#include +#include "taos.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else // Py < 3.12 + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "taos\\\\_cinterface.pyx", + "", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null; +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch; + +/* "cfunc.to_py":66 + * + * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") + * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): # <<<<<<<<<<<<<< + * def wrap(size_t ptr, int num_of_rows, list is_null): + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" + */ +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null { + PyObject_HEAD + PyObject *(*__pyx_v_f)(size_t, int, PyObject *); +}; + +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch { + PyObject_HEAD + PyObject *(*__pyx_v_f)(size_t, int, PyObject *, int, PyObject *); +}; + +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyIntCompare.proto */ +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* SetItemInt.proto */ +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ + __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) +static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* py_abs.proto */ +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); +#define __Pyx_PyNumber_Absolute(x)\ + ((likely(PyLong_CheckExact(x))) ?\ + (likely(__Pyx_PyLong_IsNonNeg(x)) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ + PyNumber_Absolute(x)) +#else +#define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* ValidateBasesTuple.proto */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); +#endif + +/* PyType_Ready.proto */ +CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction_3_0_0(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "libc.stdint" */ + +/* Module declarations from "libcpp" */ + +/* Module declarations from "cython" */ + +/* Module declarations from "taos._parser" */ +static PyObject *(*__pyx_f_4taos_7_parser__parse_string)(size_t, int, int *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_bool)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_int8_t)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_int16_t)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_int64_t)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_uint8_t)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_uint16_t)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_uint64_t)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_int)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_uint)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_float)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_double)(size_t, int, PyObject *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_timestamp)(size_t, int, PyObject *, int, PyObject *); /*proto*/ + +/* Module declarations from "taos._cinterface" */ +static PyObject *__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(TAOS_RES *, int, int); /*proto*/ +static PyObject *__pyx_f_4taos_11_cinterface_taos_fetch_block_v3(TAOS_RES *, TAOS_FIELD *, int, PyObject *); /*proto*/ +static PyObject *__pyx_f_4taos_11_cinterface_fetch_all(size_t, PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyObject *(*)(size_t, int, PyObject *)); /*proto*/ +static PyObject *__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyObject *(*)(size_t, int, PyObject *, int, PyObject *)); /*proto*/ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "taos._cinterface" +extern int __pyx_module_is_main_taos___cinterface; +int __pyx_module_is_main_taos___cinterface = 0; + +/* Implementation of "taos._cinterface" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_map; +static PyObject *__pyx_builtin_zip; +/* #### Code section: string_decls ### */ +static const char __pyx_k__6[] = "*"; +static const char __pyx_k__7[] = "."; +static const char __pyx_k__9[] = "?"; +static const char __pyx_k_dt[] = "dt"; +static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_map[] = "map"; +static const char __pyx_k_ptr[] = "ptr"; +static const char __pyx_k_zip[] = "zip"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_pytz[] = "pytz"; +static const char __pyx_k_spec[] = "__spec__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wrap[] = "wrap"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_enable[] = "enable"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_disable[] = "disable"; +static const char __pyx_k_is_null[] = "is_null"; +static const char __pyx_k_datetime[] = "datetime"; +static const char __pyx_k_dt_epoch[] = "dt_epoch"; +static const char __pyx_k_fetch_all[] = "fetch_all"; +static const char __pyx_k_isenabled[] = "isenabled"; +static const char __pyx_k_precision[] = "precision"; +static const char __pyx_k_SIZED_TYPE[] = "SIZED_TYPE"; +static const char __pyx_k_namedtuple[] = "namedtuple"; +static const char __pyx_k_taos_error[] = "taos.error"; +static const char __pyx_k_cfunc_to_py[] = "cfunc.to_py"; +static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_num_of_rows[] = "num_of_rows"; +static const char __pyx_k_CONVERT_FUNC[] = "CONVERT_FUNC"; +static const char __pyx_k_UNSIZED_TYPE[] = "UNSIZED_TYPE"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_stringsource[] = ""; +static const char __pyx_k_DatabaseError[] = "DatabaseError"; +static const char __pyx_k_InternalError[] = "InternalError"; +static const char __pyx_k_StatementError[] = "StatementError"; +static const char __pyx_k_ConnectionError[] = "ConnectionError"; +static const char __pyx_k_OperationalError[] = "OperationalError"; +static const char __pyx_k_ProgrammingError[] = "ProgrammingError"; +static const char __pyx_k_taos__cinterface[] = "taos._cinterface"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_taos__cinterface_pyx[] = "taos\\_cinterface.pyx"; +static const char __pyx_k_Pyx_CFunc_list__lParensize_t[] = "__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null..wrap"; +static const char __pyx_k_Pyx_CFunc_a4beef__list__lParen[] = "__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch..wrap"; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap(PyObject *__pyx_self, size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null); /* proto */ +static PyObject *__pyx_pf_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap(PyObject *__pyx_self, size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null, int __pyx_v_precision, PyObject *__pyx_v_dt_epoch); /* proto */ +static PyObject *__pyx_pf_4taos_11_cinterface_fetch_all(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_ptr, PyObject *__pyx_v_dt_epoch); /* proto */ +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + PyObject *__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null; + PyObject *__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch; + #endif + PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null; + PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch; + PyObject *__pyx_n_s_CONVERT_FUNC; + PyObject *__pyx_n_s_ConnectionError; + PyObject *__pyx_n_s_DatabaseError; + PyObject *__pyx_n_s_InternalError; + PyObject *__pyx_n_s_OperationalError; + PyObject *__pyx_n_s_ProgrammingError; + PyObject *__pyx_n_s_Pyx_CFunc_a4beef__list__lParen; + PyObject *__pyx_n_s_Pyx_CFunc_list__lParensize_t; + PyObject *__pyx_n_s_SIZED_TYPE; + PyObject *__pyx_n_s_StatementError; + PyObject *__pyx_n_s_UNSIZED_TYPE; + PyObject *__pyx_n_s__6; + PyObject *__pyx_kp_u__7; + PyObject *__pyx_n_s__9; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_n_s_cfunc_to_py; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_collections; + PyObject *__pyx_n_s_datetime; + PyObject *__pyx_kp_u_disable; + PyObject *__pyx_n_s_dt; + PyObject *__pyx_n_s_dt_epoch; + PyObject *__pyx_kp_u_enable; + PyObject *__pyx_n_s_fetch_all; + PyObject *__pyx_kp_u_gc; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_n_s_is_null; + PyObject *__pyx_kp_u_isenabled; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_map; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_namedtuple; + PyObject *__pyx_n_s_num_of_rows; + PyObject *__pyx_n_s_precision; + PyObject *__pyx_n_s_ptr; + PyObject *__pyx_n_s_pytz; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_kp_s_stringsource; + PyObject *__pyx_n_s_taos__cinterface; + PyObject *__pyx_kp_s_taos__cinterface_pyx; + PyObject *__pyx_n_s_taos_error; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_wrap; + PyObject *__pyx_n_s_zip; + PyObject *__pyx_int_0; + PyObject *__pyx_tuple_; + PyObject *__pyx_tuple__3; + PyObject *__pyx_tuple__8; + PyObject *__pyx_codeobj__2; + PyObject *__pyx_codeobj__4; + PyObject *__pyx_codeobj__5; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null); + Py_CLEAR(clear_module_state->__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null); + Py_CLEAR(clear_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch); + Py_CLEAR(clear_module_state->__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch); + Py_CLEAR(clear_module_state->__pyx_n_s_CONVERT_FUNC); + Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionError); + Py_CLEAR(clear_module_state->__pyx_n_s_DatabaseError); + Py_CLEAR(clear_module_state->__pyx_n_s_InternalError); + Py_CLEAR(clear_module_state->__pyx_n_s_OperationalError); + Py_CLEAR(clear_module_state->__pyx_n_s_ProgrammingError); + Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_CFunc_a4beef__list__lParen); + Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_CFunc_list__lParensize_t); + Py_CLEAR(clear_module_state->__pyx_n_s_SIZED_TYPE); + Py_CLEAR(clear_module_state->__pyx_n_s_StatementError); + Py_CLEAR(clear_module_state->__pyx_n_s_UNSIZED_TYPE); + Py_CLEAR(clear_module_state->__pyx_n_s__6); + Py_CLEAR(clear_module_state->__pyx_kp_u__7); + Py_CLEAR(clear_module_state->__pyx_n_s__9); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_n_s_cfunc_to_py); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_collections); + Py_CLEAR(clear_module_state->__pyx_n_s_datetime); + Py_CLEAR(clear_module_state->__pyx_kp_u_disable); + Py_CLEAR(clear_module_state->__pyx_n_s_dt); + Py_CLEAR(clear_module_state->__pyx_n_s_dt_epoch); + Py_CLEAR(clear_module_state->__pyx_kp_u_enable); + Py_CLEAR(clear_module_state->__pyx_n_s_fetch_all); + Py_CLEAR(clear_module_state->__pyx_kp_u_gc); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_n_s_is_null); + Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_map); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_namedtuple); + Py_CLEAR(clear_module_state->__pyx_n_s_num_of_rows); + Py_CLEAR(clear_module_state->__pyx_n_s_precision); + Py_CLEAR(clear_module_state->__pyx_n_s_ptr); + Py_CLEAR(clear_module_state->__pyx_n_s_pytz); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); + Py_CLEAR(clear_module_state->__pyx_n_s_taos__cinterface); + Py_CLEAR(clear_module_state->__pyx_kp_s_taos__cinterface_pyx); + Py_CLEAR(clear_module_state->__pyx_n_s_taos_error); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_wrap); + Py_CLEAR(clear_module_state->__pyx_n_s_zip); + Py_CLEAR(clear_module_state->__pyx_int_0); + Py_CLEAR(clear_module_state->__pyx_tuple_); + Py_CLEAR(clear_module_state->__pyx_tuple__3); + Py_CLEAR(clear_module_state->__pyx_tuple__8); + Py_CLEAR(clear_module_state->__pyx_codeobj__2); + Py_CLEAR(clear_module_state->__pyx_codeobj__4); + Py_CLEAR(clear_module_state->__pyx_codeobj__5); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null); + Py_VISIT(traverse_module_state->__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null); + Py_VISIT(traverse_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch); + Py_VISIT(traverse_module_state->__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch); + Py_VISIT(traverse_module_state->__pyx_n_s_CONVERT_FUNC); + Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionError); + Py_VISIT(traverse_module_state->__pyx_n_s_DatabaseError); + Py_VISIT(traverse_module_state->__pyx_n_s_InternalError); + Py_VISIT(traverse_module_state->__pyx_n_s_OperationalError); + Py_VISIT(traverse_module_state->__pyx_n_s_ProgrammingError); + Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_CFunc_a4beef__list__lParen); + Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_CFunc_list__lParensize_t); + Py_VISIT(traverse_module_state->__pyx_n_s_SIZED_TYPE); + Py_VISIT(traverse_module_state->__pyx_n_s_StatementError); + Py_VISIT(traverse_module_state->__pyx_n_s_UNSIZED_TYPE); + Py_VISIT(traverse_module_state->__pyx_n_s__6); + Py_VISIT(traverse_module_state->__pyx_kp_u__7); + Py_VISIT(traverse_module_state->__pyx_n_s__9); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_n_s_cfunc_to_py); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_collections); + Py_VISIT(traverse_module_state->__pyx_n_s_datetime); + Py_VISIT(traverse_module_state->__pyx_kp_u_disable); + Py_VISIT(traverse_module_state->__pyx_n_s_dt); + Py_VISIT(traverse_module_state->__pyx_n_s_dt_epoch); + Py_VISIT(traverse_module_state->__pyx_kp_u_enable); + Py_VISIT(traverse_module_state->__pyx_n_s_fetch_all); + Py_VISIT(traverse_module_state->__pyx_kp_u_gc); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_n_s_is_null); + Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_map); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_namedtuple); + Py_VISIT(traverse_module_state->__pyx_n_s_num_of_rows); + Py_VISIT(traverse_module_state->__pyx_n_s_precision); + Py_VISIT(traverse_module_state->__pyx_n_s_ptr); + Py_VISIT(traverse_module_state->__pyx_n_s_pytz); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); + Py_VISIT(traverse_module_state->__pyx_n_s_taos__cinterface); + Py_VISIT(traverse_module_state->__pyx_kp_s_taos__cinterface_pyx); + Py_VISIT(traverse_module_state->__pyx_n_s_taos_error); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_wrap); + Py_VISIT(traverse_module_state->__pyx_n_s_zip); + Py_VISIT(traverse_module_state->__pyx_int_0); + Py_VISIT(traverse_module_state->__pyx_tuple_); + Py_VISIT(traverse_module_state->__pyx_tuple__3); + Py_VISIT(traverse_module_state->__pyx_tuple__8); + Py_VISIT(traverse_module_state->__pyx_codeobj__2); + Py_VISIT(traverse_module_state->__pyx_codeobj__4); + Py_VISIT(traverse_module_state->__pyx_codeobj__5); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#define __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null __pyx_mstate_global->__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null +#define __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch __pyx_mstate_global->__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch +#endif +#define __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null __pyx_mstate_global->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null +#define __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch __pyx_mstate_global->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch +#define __pyx_n_s_CONVERT_FUNC __pyx_mstate_global->__pyx_n_s_CONVERT_FUNC +#define __pyx_n_s_ConnectionError __pyx_mstate_global->__pyx_n_s_ConnectionError +#define __pyx_n_s_DatabaseError __pyx_mstate_global->__pyx_n_s_DatabaseError +#define __pyx_n_s_InternalError __pyx_mstate_global->__pyx_n_s_InternalError +#define __pyx_n_s_OperationalError __pyx_mstate_global->__pyx_n_s_OperationalError +#define __pyx_n_s_ProgrammingError __pyx_mstate_global->__pyx_n_s_ProgrammingError +#define __pyx_n_s_Pyx_CFunc_a4beef__list__lParen __pyx_mstate_global->__pyx_n_s_Pyx_CFunc_a4beef__list__lParen +#define __pyx_n_s_Pyx_CFunc_list__lParensize_t __pyx_mstate_global->__pyx_n_s_Pyx_CFunc_list__lParensize_t +#define __pyx_n_s_SIZED_TYPE __pyx_mstate_global->__pyx_n_s_SIZED_TYPE +#define __pyx_n_s_StatementError __pyx_mstate_global->__pyx_n_s_StatementError +#define __pyx_n_s_UNSIZED_TYPE __pyx_mstate_global->__pyx_n_s_UNSIZED_TYPE +#define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 +#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 +#define __pyx_n_s__9 __pyx_mstate_global->__pyx_n_s__9 +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_s_cfunc_to_py __pyx_mstate_global->__pyx_n_s_cfunc_to_py +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections +#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime +#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable +#define __pyx_n_s_dt __pyx_mstate_global->__pyx_n_s_dt +#define __pyx_n_s_dt_epoch __pyx_mstate_global->__pyx_n_s_dt_epoch +#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable +#define __pyx_n_s_fetch_all __pyx_mstate_global->__pyx_n_s_fetch_all +#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_s_is_null __pyx_mstate_global->__pyx_n_s_is_null +#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_namedtuple __pyx_mstate_global->__pyx_n_s_namedtuple +#define __pyx_n_s_num_of_rows __pyx_mstate_global->__pyx_n_s_num_of_rows +#define __pyx_n_s_precision __pyx_mstate_global->__pyx_n_s_precision +#define __pyx_n_s_ptr __pyx_mstate_global->__pyx_n_s_ptr +#define __pyx_n_s_pytz __pyx_mstate_global->__pyx_n_s_pytz +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource +#define __pyx_n_s_taos__cinterface __pyx_mstate_global->__pyx_n_s_taos__cinterface +#define __pyx_kp_s_taos__cinterface_pyx __pyx_mstate_global->__pyx_kp_s_taos__cinterface_pyx +#define __pyx_n_s_taos_error __pyx_mstate_global->__pyx_n_s_taos_error +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_wrap __pyx_mstate_global->__pyx_n_s_wrap +#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip +#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 +#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ +#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 +#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 +#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 +#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 +#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 +/* #### Code section: module_code ### */ + +/* "cfunc.to_py":67 + * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") + * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): + * def wrap(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" + * return f(ptr, num_of_rows, is_null) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap, "wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list"); +static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap = {"wrap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap}; +static PyObject *__pyx_pw_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + size_t __pyx_v_ptr; + int __pyx_v_num_of_rows; + PyObject *__pyx_v_is_null = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrap (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptr,&__pyx_n_s_num_of_rows,&__pyx_n_s_is_null,0}; + PyObject* values[3] = {0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptr)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_num_of_rows)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 1); __PYX_ERR(1, 67, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_null)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 2); __PYX_ERR(1, 67, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wrap") < 0)) __PYX_ERR(1, 67, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_ptr = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_ptr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + __pyx_v_num_of_rows = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_of_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + __pyx_v_is_null = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 67, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_null), (&PyList_Type), 1, "is_null", 1))) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_r = __pyx_pf_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap(__pyx_self, __pyx_v_ptr, __pyx_v_num_of_rows, __pyx_v_is_null); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap(PyObject *__pyx_self, size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *__pyx_cur_scope; + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrap", 0); + __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_TraceCall("wrap", __pyx_f[1], 67, 0, __PYX_ERR(1, 67, __pyx_L1_error)); + + /* "cfunc.to_py":69 + * def wrap(size_t ptr, int num_of_rows, list is_null): + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" + * return f(ptr, num_of_rows, is_null) # <<<<<<<<<<<<<< + * return wrap + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_ptr, __pyx_v_num_of_rows, __pyx_v_is_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cfunc.to_py":67 + * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") + * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): + * def wrap(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" + * return f(ptr, num_of_rows, is_null) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cfunc.to_py":66 + * + * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") + * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): # <<<<<<<<<<<<<< + * def wrap(size_t ptr, int num_of_rows, list is_null): + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" + */ + +static PyObject *__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyObject *(*__pyx_v_f)(size_t, int, PyObject *)) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *__pyx_cur_scope; + PyObject *__pyx_v_wrap = 0; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", 0); + __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(1, 66, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __Pyx_TraceCall("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", __pyx_f[1], 66, 0, __PYX_ERR(1, 66, __pyx_L1_error)); + __pyx_cur_scope->__pyx_v_f = __pyx_v_f; + + /* "cfunc.to_py":67 + * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") + * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): + * def wrap(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" + * return f(ptr, num_of_rows, is_null) + */ + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap, 0, __pyx_n_s_Pyx_CFunc_list__lParensize_t, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_wrap = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cfunc.to_py":70 + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" + * return f(ptr, num_of_rows, is_null) + * return wrap # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrap); + __pyx_r = __pyx_v_wrap; + goto __pyx_L0; + + /* "cfunc.to_py":66 + * + * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") + * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): # <<<<<<<<<<<<<< + * def wrap(size_t ptr, int num_of_rows, list is_null): + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrap); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cfunc.to_py":67 + * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") + * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): + * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): # <<<<<<<<<<<<<< + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" + * return f(ptr, num_of_rows, is_null, precision, dt_epoch) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap, "wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list"); +static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap = {"wrap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap}; +static PyObject *__pyx_pw_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + size_t __pyx_v_ptr; + int __pyx_v_num_of_rows; + PyObject *__pyx_v_is_null = 0; + int __pyx_v_precision; + PyObject *__pyx_v_dt_epoch = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrap (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptr,&__pyx_n_s_num_of_rows,&__pyx_n_s_is_null,&__pyx_n_s_precision,&__pyx_n_s_dt_epoch,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptr)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_num_of_rows)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, 1); __PYX_ERR(1, 67, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_null)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, 2); __PYX_ERR(1, 67, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, 3); __PYX_ERR(1, 67, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dt_epoch)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, 4); __PYX_ERR(1, 67, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wrap") < 0)) __PYX_ERR(1, 67, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 5)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + } + __pyx_v_ptr = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_ptr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + __pyx_v_num_of_rows = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_of_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + __pyx_v_is_null = ((PyObject*)values[2]); + __pyx_v_precision = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_precision == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) + __pyx_v_dt_epoch = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, __pyx_nargs); __PYX_ERR(1, 67, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_null), (&PyList_Type), 1, "is_null", 1))) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_r = __pyx_pf_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap(__pyx_self, __pyx_v_ptr, __pyx_v_num_of_rows, __pyx_v_is_null, __pyx_v_precision, __pyx_v_dt_epoch); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap(PyObject *__pyx_self, size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null, int __pyx_v_precision, PyObject *__pyx_v_dt_epoch) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *__pyx_cur_scope; + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrap", 0); + __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_TraceCall("wrap", __pyx_f[1], 67, 0, __PYX_ERR(1, 67, __pyx_L1_error)); + + /* "cfunc.to_py":69 + * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" + * return f(ptr, num_of_rows, is_null, precision, dt_epoch) # <<<<<<<<<<<<<< + * return wrap + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_ptr, __pyx_v_num_of_rows, __pyx_v_is_null, __pyx_v_precision, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cfunc.to_py":67 + * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") + * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): + * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): # <<<<<<<<<<<<<< + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" + * return f(ptr, num_of_rows, is_null, precision, dt_epoch) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cfunc.to_py":66 + * + * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") + * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): # <<<<<<<<<<<<<< + * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" + */ + +static PyObject *__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyObject *(*__pyx_v_f)(size_t, int, PyObject *, int, PyObject *)) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *__pyx_cur_scope; + PyObject *__pyx_v_wrap = 0; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", 0); + __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(1, 66, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __Pyx_TraceCall("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", __pyx_f[1], 66, 0, __PYX_ERR(1, 66, __pyx_L1_error)); + __pyx_cur_scope->__pyx_v_f = __pyx_v_f; + + /* "cfunc.to_py":67 + * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") + * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): + * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): # <<<<<<<<<<<<<< + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" + * return f(ptr, num_of_rows, is_null, precision, dt_epoch) + */ + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap, 0, __pyx_n_s_Pyx_CFunc_a4beef__list__lParen, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_wrap = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cfunc.to_py":70 + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" + * return f(ptr, num_of_rows, is_null, precision, dt_epoch) + * return wrap # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrap); + __pyx_r = __pyx_v_wrap; + goto __pyx_L0; + + /* "cfunc.to_py":66 + * + * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") + * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): # <<<<<<<<<<<<<< + * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrap); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_cinterface.pyx":11 + * _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string) + * + * cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): # <<<<<<<<<<<<<< + * cdef list is_null = [] + * cdef int r + */ + +static PyObject *__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(TAOS_RES *__pyx_v_res, int __pyx_v_field, int __pyx_v_rows) { + PyObject *__pyx_v_is_null = 0; + int __pyx_v_r; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("taos_get_column_data_is_null", 0); + __Pyx_TraceCall("taos_get_column_data_is_null", __pyx_f[0], 11, 0, __PYX_ERR(0, 11, __pyx_L1_error)); + + /* "taos/_cinterface.pyx":12 + * + * cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): + * cdef list is_null = [] # <<<<<<<<<<<<<< + * cdef int r + * for r in range(rows): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_is_null = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_cinterface.pyx":14 + * cdef list is_null = [] + * cdef int r + * for r in range(rows): # <<<<<<<<<<<<<< + * is_null.append(taos_is_null(res, r, field)) + * + */ + __pyx_t_2 = __pyx_v_rows; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_r = __pyx_t_4; + + /* "taos/_cinterface.pyx":15 + * cdef int r + * for r in range(rows): + * is_null.append(taos_is_null(res, r, field)) # <<<<<<<<<<<<<< + * + * return is_null + */ + __pyx_t_1 = __Pyx_PyBool_FromLong(taos_is_null(__pyx_v_res, __pyx_v_r, __pyx_v_field)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_is_null, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "taos/_cinterface.pyx":17 + * is_null.append(taos_is_null(res, r, field)) + * + * return is_null # <<<<<<<<<<<<<< + * + * # --------------------------------------------- parser ---------------------------------------------------------------v + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_is_null); + __pyx_r = __pyx_v_is_null; + goto __pyx_L0; + + /* "taos/_cinterface.pyx":11 + * _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string) + * + * cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): # <<<<<<<<<<<<<< + * cdef list is_null = [] + * cdef int r + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._cinterface.taos_get_column_data_is_null", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_is_null); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_cinterface.pyx":70 + * + * + * cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch): # <<<<<<<<<<<<<< + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(res, &pblock) + */ + +static PyObject *__pyx_f_4taos_11_cinterface_taos_fetch_block_v3(TAOS_RES *__pyx_v_res, TAOS_FIELD *__pyx_v_fields, int __pyx_v_field_count, PyObject *__pyx_v_dt_epoch) { + TAOS_ROW __pyx_v_pblock; + PyObject *__pyx_v_num_of_rows = NULL; + int __pyx_v_precision; + PyObject *__pyx_v_blocks = NULL; + int __pyx_v_i; + void *__pyx_v_data; + TAOS_FIELD __pyx_v_field; + int *__pyx_v_offsets; + PyObject *__pyx_v_is_null = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int8_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("taos_fetch_block_v3", 0); + __Pyx_TraceCall("taos_fetch_block_v3", __pyx_f[0], 70, 0, __PYX_ERR(0, 70, __pyx_L1_error)); + + /* "taos/_cinterface.pyx":72 + * cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch): + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(res, &pblock) # <<<<<<<<<<<<<< + * if num_of_rows == 0: + * return [], 0 + */ + __pyx_t_1 = __Pyx_PyInt_From_int(taos_fetch_block(__pyx_v_res, (&__pyx_v_pblock))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_num_of_rows = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_cinterface.pyx":73 + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(res, &pblock) + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * return [], 0 + * + */ + __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 73, __pyx_L1_error) + if (__pyx_t_2) { + + /* "taos/_cinterface.pyx":74 + * num_of_rows = taos_fetch_block(res, &pblock) + * if num_of_rows == 0: + * return [], 0 # <<<<<<<<<<<<<< + * + * precision = taos_result_precision(res) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "taos/_cinterface.pyx":73 + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(res, &pblock) + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * return [], 0 + * + */ + } + + /* "taos/_cinterface.pyx":76 + * return [], 0 + * + * precision = taos_result_precision(res) # <<<<<<<<<<<<<< + * blocks = [None] * field_count + * + */ + __pyx_v_precision = taos_result_precision(__pyx_v_res); + + /* "taos/_cinterface.pyx":77 + * + * precision = taos_result_precision(res) + * blocks = [None] * field_count # <<<<<<<<<<<<<< + * + * cdef int i + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_field_count<0) ? 0:__pyx_v_field_count)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_field_count; __pyx_temp++) { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None); + } + } + __pyx_v_blocks = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "taos/_cinterface.pyx":80 + * + * cdef int i + * for i in range(field_count): # <<<<<<<<<<<<<< + * data = pblock[i] + * field = fields[i] + */ + __pyx_t_4 = __pyx_v_field_count; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "taos/_cinterface.pyx":81 + * cdef int i + * for i in range(field_count): + * data = pblock[i] # <<<<<<<<<<<<<< + * field = fields[i] + * + */ + __pyx_v_data = (__pyx_v_pblock[__pyx_v_i]); + + /* "taos/_cinterface.pyx":82 + * for i in range(field_count): + * data = pblock[i] + * field = fields[i] # <<<<<<<<<<<<<< + * + * if field.type in UNSIZED_TYPE: + */ + __pyx_v_field = (__pyx_v_fields[__pyx_v_i]); + + /* "taos/_cinterface.pyx":84 + * field = fields[i] + * + * if field.type in UNSIZED_TYPE: # <<<<<<<<<<<<<< + * offsets = taos_get_column_data_offset(res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) + */ + __pyx_t_3 = __Pyx_PyInt_From_int8_t(__pyx_v_field.type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UNSIZED_TYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "taos/_cinterface.pyx":85 + * + * if field.type in UNSIZED_TYPE: + * offsets = taos_get_column_data_offset(res, i) # <<<<<<<<<<<<<< + * blocks[i] = _parse_string(data, num_of_rows, offsets) + * elif field.type in SIZED_TYPE: + */ + __pyx_v_offsets = taos_get_column_data_offset(__pyx_v_res, __pyx_v_i); + + /* "taos/_cinterface.pyx":86 + * if field.type in UNSIZED_TYPE: + * offsets = taos_get_column_data_offset(res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) # <<<<<<<<<<<<<< + * elif field.type in SIZED_TYPE: + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + */ + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4taos_7_parser__parse_string(((size_t)__pyx_v_data), __pyx_t_7, __pyx_v_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_cinterface.pyx":84 + * field = fields[i] + * + * if field.type in UNSIZED_TYPE: # <<<<<<<<<<<<<< + * offsets = taos_get_column_data_offset(res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) + */ + goto __pyx_L6; + } + + /* "taos/_cinterface.pyx":87 + * offsets = taos_get_column_data_offset(res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) + * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + */ + __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_field.type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "taos/_cinterface.pyx":88 + * blocks[i] = _parse_string(data, num_of_rows, offsets) + * elif field.type in SIZED_TYPE: + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) # <<<<<<<<<<<<<< + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + */ + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(__pyx_v_res, __pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_is_null, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "taos/_cinterface.pyx":89 + * elif field.type in SIZED_TYPE: + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) # <<<<<<<<<<<<<< + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CONVERT_FUNC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_field.type, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_1, __pyx_v_num_of_rows, __pyx_v_is_null}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_cinterface.pyx":87 + * offsets = taos_get_column_data_offset(res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) + * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + */ + goto __pyx_L6; + } + + /* "taos/_cinterface.pyx":90 + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + */ + __pyx_t_10 = __pyx_v_field.type; + __pyx_t_2 = (__pyx_t_10 == TSDB_DATA_TYPE_TIMESTAMP); + if (__pyx_t_2) { + + /* "taos/_cinterface.pyx":91 + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) # <<<<<<<<<<<<<< + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + * else: + */ + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(__pyx_v_res, __pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_is_null, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "taos/_cinterface.pyx":92 + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) # <<<<<<<<<<<<<< + * else: + * pass + */ + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4taos_7_parser__parse_timestamp(((size_t)__pyx_v_data), __pyx_t_7, __pyx_v_is_null, __pyx_v_precision, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_cinterface.pyx":90 + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< + * is_null = taos_get_column_data_is_null(res, i, num_of_rows) + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + */ + goto __pyx_L6; + } + + /* "taos/_cinterface.pyx":94 + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + * else: + * pass # <<<<<<<<<<<<<< + * + * return blocks, abs(num_of_rows) + */ + /*else*/ { + } + __pyx_L6:; + } + + /* "taos/_cinterface.pyx":96 + * pass + * + * return blocks, abs(num_of_rows) # <<<<<<<<<<<<<< + * + * cpdef fetch_all(size_t ptr, dt_epoch): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_num_of_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_blocks); + __Pyx_GIVEREF(__pyx_v_blocks); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_blocks); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "taos/_cinterface.pyx":70 + * + * + * cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch): # <<<<<<<<<<<<<< + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(res, &pblock) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("taos._cinterface.taos_fetch_block_v3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_num_of_rows); + __Pyx_XDECREF(__pyx_v_blocks); + __Pyx_XDECREF(__pyx_v_is_null); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_cinterface.pyx":98 + * return blocks, abs(num_of_rows) + * + * cpdef fetch_all(size_t ptr, dt_epoch): # <<<<<<<<<<<<<< + * res = ptr + * fields = taos_fetch_fields(res) + */ + +static PyObject *__pyx_pw_4taos_11_cinterface_1fetch_all(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyObject *__pyx_f_4taos_11_cinterface_fetch_all(size_t __pyx_v_ptr, PyObject *__pyx_v_dt_epoch, CYTHON_UNUSED int __pyx_skip_dispatch) { + TAOS_RES *__pyx_v_res; + TAOS_FIELD *__pyx_v_fields; + int __pyx_v_field_count; + PyObject *__pyx_v_chunks = NULL; + int __pyx_v_row_count; + PyObject *__pyx_v_block = NULL; + PyObject *__pyx_v_num_of_rows = NULL; + int __pyx_v_errno; + PyObject *__pyx_7genexpr__pyx_v_chunk = NULL; + PyObject *__pyx_7genexpr__pyx_v_row = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__5) + __Pyx_RefNannySetupContext("fetch_all", 0); + __Pyx_TraceCall("fetch_all", __pyx_f[0], 98, 0, __PYX_ERR(0, 98, __pyx_L1_error)); + + /* "taos/_cinterface.pyx":99 + * + * cpdef fetch_all(size_t ptr, dt_epoch): + * res = ptr # <<<<<<<<<<<<<< + * fields = taos_fetch_fields(res) + * field_count = taos_field_count(res) + */ + __pyx_v_res = ((TAOS_RES *)__pyx_v_ptr); + + /* "taos/_cinterface.pyx":100 + * cpdef fetch_all(size_t ptr, dt_epoch): + * res = ptr + * fields = taos_fetch_fields(res) # <<<<<<<<<<<<<< + * field_count = taos_field_count(res) + * + */ + __pyx_v_fields = taos_fetch_fields(__pyx_v_res); + + /* "taos/_cinterface.pyx":101 + * res = ptr + * fields = taos_fetch_fields(res) + * field_count = taos_field_count(res) # <<<<<<<<<<<<<< + * + * chunks = [] + */ + __pyx_v_field_count = taos_field_count(__pyx_v_res); + + /* "taos/_cinterface.pyx":103 + * field_count = taos_field_count(res) + * + * chunks = [] # <<<<<<<<<<<<<< + * cdef int row_count = 0 + * while True: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_chunks = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_cinterface.pyx":104 + * + * chunks = [] + * cdef int row_count = 0 # <<<<<<<<<<<<<< + * while True: + * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) + */ + __pyx_v_row_count = 0; + + /* "taos/_cinterface.pyx":105 + * chunks = [] + * cdef int row_count = 0 + * while True: # <<<<<<<<<<<<<< + * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) + * errno = taos_errno(res) + */ + while (1) { + + /* "taos/_cinterface.pyx":106 + * cdef int row_count = 0 + * while True: + * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) # <<<<<<<<<<<<<< + * errno = taos_errno(res) + * + */ + __pyx_t_1 = __pyx_f_4taos_11_cinterface_taos_fetch_block_v3(__pyx_v_res, __pyx_v_fields, __pyx_v_field_count, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 106, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); + index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_5 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_block, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_num_of_rows, __pyx_t_3); + __pyx_t_3 = 0; + + /* "taos/_cinterface.pyx":107 + * while True: + * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) + * errno = taos_errno(res) # <<<<<<<<<<<<<< + * + * if errno != 0: + */ + __pyx_v_errno = taos_errno(__pyx_v_res); + + /* "taos/_cinterface.pyx":109 + * errno = taos_errno(res) + * + * if errno != 0: # <<<<<<<<<<<<<< + * raise ProgrammingError(taos_errstr(res), errno) + * + */ + __pyx_t_6 = (__pyx_v_errno != 0); + if (unlikely(__pyx_t_6)) { + + /* "taos/_cinterface.pyx":110 + * + * if errno != 0: + * raise ProgrammingError(taos_errstr(res), errno) # <<<<<<<<<<<<<< + * + * if num_of_rows == 0: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyBytes_FromString(taos_errstr(__pyx_v_res)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 110, __pyx_L1_error) + + /* "taos/_cinterface.pyx":109 + * errno = taos_errno(res) + * + * if errno != 0: # <<<<<<<<<<<<<< + * raise ProgrammingError(taos_errstr(res), errno) + * + */ + } + + /* "taos/_cinterface.pyx":112 + * raise ProgrammingError(taos_errstr(res), errno) + * + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 112, __pyx_L1_error) + if (__pyx_t_6) { + + /* "taos/_cinterface.pyx":113 + * + * if num_of_rows == 0: + * break # <<<<<<<<<<<<<< + * + * row_count += num_of_rows + */ + goto __pyx_L4_break; + + /* "taos/_cinterface.pyx":112 + * raise ProgrammingError(taos_errstr(res), errno) + * + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "taos/_cinterface.pyx":115 + * break + * + * row_count += num_of_rows # <<<<<<<<<<<<<< + * chunks.append(block) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_row_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_num_of_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_row_count = __pyx_t_8; + + /* "taos/_cinterface.pyx":116 + * + * row_count += num_of_rows + * chunks.append(block) # <<<<<<<<<<<<<< + * + * return [row for chunk in chunks for row in map(tuple, zip(*chunk))] + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_chunks, __pyx_v_block); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error) + } + __pyx_L4_break:; + + /* "taos/_cinterface.pyx":118 + * chunks.append(block) + * + * return [row for chunk in chunks for row in map(tuple, zip(*chunk))] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_v_chunks; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; + for (;;) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 118, __pyx_L11_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_chunk, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_7genexpr__pyx_v_chunk); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF((PyObject *)(&PyTuple_Type)); + __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyTuple_Type))); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L11_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 118, __pyx_L11_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 118, __pyx_L11_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_12(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 118, __pyx_L11_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_row, __pyx_t_2); + __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_7genexpr__pyx_v_row))) __PYX_ERR(0, 118, __pyx_L11_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_chunk); __pyx_7genexpr__pyx_v_chunk = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_row); __pyx_7genexpr__pyx_v_row = 0; + goto __pyx_L18_exit_scope; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_chunk); __pyx_7genexpr__pyx_v_chunk = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_row); __pyx_7genexpr__pyx_v_row = 0; + goto __pyx_L1_error; + __pyx_L18_exit_scope:; + } /* exit inner scope */ + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "taos/_cinterface.pyx":98 + * return blocks, abs(num_of_rows) + * + * cpdef fetch_all(size_t ptr, dt_epoch): # <<<<<<<<<<<<<< + * res = ptr + * fields = taos_fetch_fields(res) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("taos._cinterface.fetch_all", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_chunks); + __Pyx_XDECREF(__pyx_v_block); + __Pyx_XDECREF(__pyx_v_num_of_rows); + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_chunk); + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_row); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_11_cinterface_1fetch_all(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_11_cinterface_fetch_all, "fetch_all(size_t ptr, dt_epoch)"); +static PyMethodDef __pyx_mdef_4taos_11_cinterface_1fetch_all = {"fetch_all", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_11_cinterface_1fetch_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_11_cinterface_fetch_all}; +static PyObject *__pyx_pw_4taos_11_cinterface_1fetch_all(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + size_t __pyx_v_ptr; + PyObject *__pyx_v_dt_epoch = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetch_all (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptr,&__pyx_n_s_dt_epoch,0}; + PyObject* values[2] = {0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptr)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dt_epoch)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("fetch_all", 1, 2, 2, 1); __PYX_ERR(0, 98, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetch_all") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_ptr = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_ptr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) + __pyx_v_dt_epoch = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fetch_all", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._cinterface.fetch_all", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_11_cinterface_fetch_all(__pyx_self, __pyx_v_ptr, __pyx_v_dt_epoch); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_11_cinterface_fetch_all(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_ptr, PyObject *__pyx_v_dt_epoch) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__5) + __Pyx_RefNannySetupContext("fetch_all", 0); + __Pyx_TraceCall("fetch_all (wrapper)", __pyx_f[0], 98, 0, __PYX_ERR(0, 98, __pyx_L1_error)); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_4taos_11_cinterface_fetch_all(__pyx_v_ptr, __pyx_v_dt_epoch, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __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("taos._cinterface.fetch_all", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null[8]; +static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null = 0; + +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null)))) { + o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null]; + memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null)); + (void) PyObject_INIT(o, t); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null)))) { + __pyx_freelist___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null}, + {Py_tp_new, (void *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null}, + {0, 0}, +}; +static PyType_Spec __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_spec = { + "taos._cinterface.__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", + sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_slots, +}; +#else + +static PyTypeObject __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null = { + PyVarObject_HEAD_INIT(0, 0) + "taos._cinterface.""__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", /*tp_name*/ + sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch[8]; +static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch = 0; + +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch)))) { + o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch]; + memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch)); + (void) PyObject_INIT(o, t); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch)))) { + __pyx_freelist___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch}, + {Py_tp_new, (void *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch}, + {0, 0}, +}; +static PyType_Spec __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_spec = { + "taos._cinterface.__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", + sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_slots, +}; +#else + +static PyTypeObject __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch = { + PyVarObject_HEAD_INIT(0, 0) + "taos._cinterface.""__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", /*tp_name*/ + sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_CONVERT_FUNC, __pyx_k_CONVERT_FUNC, sizeof(__pyx_k_CONVERT_FUNC), 0, 0, 1, 1}, + {&__pyx_n_s_ConnectionError, __pyx_k_ConnectionError, sizeof(__pyx_k_ConnectionError), 0, 0, 1, 1}, + {&__pyx_n_s_DatabaseError, __pyx_k_DatabaseError, sizeof(__pyx_k_DatabaseError), 0, 0, 1, 1}, + {&__pyx_n_s_InternalError, __pyx_k_InternalError, sizeof(__pyx_k_InternalError), 0, 0, 1, 1}, + {&__pyx_n_s_OperationalError, __pyx_k_OperationalError, sizeof(__pyx_k_OperationalError), 0, 0, 1, 1}, + {&__pyx_n_s_ProgrammingError, __pyx_k_ProgrammingError, sizeof(__pyx_k_ProgrammingError), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_CFunc_a4beef__list__lParen, __pyx_k_Pyx_CFunc_a4beef__list__lParen, sizeof(__pyx_k_Pyx_CFunc_a4beef__list__lParen), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_CFunc_list__lParensize_t, __pyx_k_Pyx_CFunc_list__lParensize_t, sizeof(__pyx_k_Pyx_CFunc_list__lParensize_t), 0, 0, 1, 1}, + {&__pyx_n_s_SIZED_TYPE, __pyx_k_SIZED_TYPE, sizeof(__pyx_k_SIZED_TYPE), 0, 0, 1, 1}, + {&__pyx_n_s_StatementError, __pyx_k_StatementError, sizeof(__pyx_k_StatementError), 0, 0, 1, 1}, + {&__pyx_n_s_UNSIZED_TYPE, __pyx_k_UNSIZED_TYPE, sizeof(__pyx_k_UNSIZED_TYPE), 0, 0, 1, 1}, + {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, + {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, + {&__pyx_n_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_s_cfunc_to_py, __pyx_k_cfunc_to_py, sizeof(__pyx_k_cfunc_to_py), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, + {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, + {&__pyx_n_s_dt_epoch, __pyx_k_dt_epoch, sizeof(__pyx_k_dt_epoch), 0, 0, 1, 1}, + {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, + {&__pyx_n_s_fetch_all, __pyx_k_fetch_all, sizeof(__pyx_k_fetch_all), 0, 0, 1, 1}, + {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_s_is_null, __pyx_k_is_null, sizeof(__pyx_k_is_null), 0, 0, 1, 1}, + {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, + {&__pyx_n_s_num_of_rows, __pyx_k_num_of_rows, sizeof(__pyx_k_num_of_rows), 0, 0, 1, 1}, + {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1}, + {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, + {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_taos__cinterface, __pyx_k_taos__cinterface, sizeof(__pyx_k_taos__cinterface), 0, 0, 1, 1}, + {&__pyx_kp_s_taos__cinterface_pyx, __pyx_k_taos__cinterface_pyx, sizeof(__pyx_k_taos__cinterface_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_taos_error, __pyx_k_taos_error, sizeof(__pyx_k_taos_error), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_wrap, __pyx_k_wrap, sizeof(__pyx_k_wrap), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 14, __pyx_L1_error) + __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 118, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "cfunc.to_py":67 + * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") + * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): + * def wrap(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" + * return f(ptr, num_of_rows, is_null) + */ + __pyx_tuple_ = PyTuple_Pack(3, __pyx_n_s_ptr, __pyx_n_s_num_of_rows, __pyx_n_s_is_null); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 67, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(5, __pyx_n_s_ptr, __pyx_n_s_num_of_rows, __pyx_n_s_is_null, __pyx_n_s_precision, __pyx_n_s_dt_epoch); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 67, __pyx_L1_error) + + /* "taos/_cinterface.pyx":98 + * return blocks, abs(num_of_rows) + * + * cpdef fetch_all(size_t ptr, dt_epoch): # <<<<<<<<<<<<<< + * res = ptr + * fields = taos_fetch_fields(res) + */ + __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_ptr, __pyx_n_s_dt_epoch); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__cinterface_pyx, __pyx_n_s_fetch_all, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("taos_get_column_data_is_null", (void (*)(void))__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null, "PyObject *(TAOS_RES *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("taos_fetch_block_v3", (void (*)(void))__pyx_f_4taos_11_cinterface_taos_fetch_block_v3, "PyObject *(TAOS_RES *, TAOS_FIELD *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_spec, NULL); if (unlikely(!__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null)) __PYX_ERR(1, 66, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_spec, __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null) < 0) __PYX_ERR(1, 66, __pyx_L1_error) + #else + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null = &__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null) < 0) __PYX_ERR(1, 66, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null->tp_dictoffset && __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_spec, NULL); if (unlikely(!__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch)) __PYX_ERR(1, 66, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_spec, __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch) < 0) __PYX_ERR(1, 66, __pyx_L1_error) + #else + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch = &__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch) < 0) __PYX_ERR(1, 66, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch->tp_dictoffset && __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("taos._parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_string", (void (**)(void))&__pyx_f_4taos_7_parser__parse_string, "PyObject *(size_t, int, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_bool", (void (**)(void))&__pyx_f_4taos_7_parser__parse_bool, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_int8_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_int8_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_int16_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_int16_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_int64_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_int64_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_uint8_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_uint8_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_uint16_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_uint16_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_uint64_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_uint64_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_int", (void (**)(void))&__pyx_f_4taos_7_parser__parse_int, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_uint", (void (**)(void))&__pyx_f_4taos_7_parser__parse_uint, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_float", (void (**)(void))&__pyx_f_4taos_7_parser__parse_float, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_double", (void (**)(void))&__pyx_f_4taos_7_parser__parse_double, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_timestamp", (void (**)(void))&__pyx_f_4taos_7_parser__parse_timestamp, "PyObject *(size_t, int, PyObject *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__cinterface(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__cinterface}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_cinterface", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_cinterface(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_cinterface(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__cinterface(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__cinterface(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__cinterface(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + __Pyx_TraceDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_cinterface' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_cinterface", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to _cinterface pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__cinterface(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_taos___cinterface) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "taos._cinterface")) { + if (unlikely((PyDict_SetItemString(modules, "taos._cinterface", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__cinterface(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); + + /* "taos/_cinterface.pyx":4 + * + * import cython + * import datetime as dt # <<<<<<<<<<<<<< + * import pytz + * from collections import namedtuple + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_cinterface.pyx":5 + * import cython + * import datetime as dt + * import pytz # <<<<<<<<<<<<<< + * from collections import namedtuple + * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pytz, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_cinterface.pyx":6 + * import datetime as dt + * import pytz + * from collections import namedtuple # <<<<<<<<<<<<<< + * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError + * from taos._parser cimport (_parse_bool, _parse_int8_t, _parse_int16_t, _parse_int, _parse_int64_t, _parse_float, _parse_double, _parse_timestamp, + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_namedtuple); + __Pyx_GIVEREF(__pyx_n_s_namedtuple); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_cinterface.pyx":7 + * import pytz + * from collections import namedtuple + * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError # <<<<<<<<<<<<<< + * from taos._parser cimport (_parse_bool, _parse_int8_t, _parse_int16_t, _parse_int, _parse_int64_t, _parse_float, _parse_double, _parse_timestamp, + * _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string) + */ + __pyx_t_3 = PyList_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_ProgrammingError); + __Pyx_GIVEREF(__pyx_n_s_ProgrammingError); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ProgrammingError); + __Pyx_INCREF(__pyx_n_s_OperationalError); + __Pyx_GIVEREF(__pyx_n_s_OperationalError); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_OperationalError); + __Pyx_INCREF(__pyx_n_s_ConnectionError); + __Pyx_GIVEREF(__pyx_n_s_ConnectionError); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ConnectionError); + __Pyx_INCREF(__pyx_n_s_DatabaseError); + __Pyx_GIVEREF(__pyx_n_s_DatabaseError); + PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_DatabaseError); + __Pyx_INCREF(__pyx_n_s_StatementError); + __Pyx_GIVEREF(__pyx_n_s_StatementError); + PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_StatementError); + __Pyx_INCREF(__pyx_n_s_InternalError); + __Pyx_GIVEREF(__pyx_n_s_InternalError); + PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_InternalError); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_taos_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProgrammingError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OperationalError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConnectionError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DatabaseError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StatementError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_StatementError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InternalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InternalError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_cinterface.pyx":23 + * # --------------------------------------------- parser ---------------------------------------------------------------^ + * SIZED_TYPE = { + * TSDB_DATA_TYPE_BOOL, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_TINYINT, + * TSDB_DATA_TYPE_SMALLINT, + */ + __pyx_t_2 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BOOL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "taos/_cinterface.pyx":24 + * SIZED_TYPE = { + * TSDB_DATA_TYPE_BOOL, + * TSDB_DATA_TYPE_TINYINT, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_SMALLINT, + * TSDB_DATA_TYPE_INT, + */ + __pyx_t_3 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_TINYINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "taos/_cinterface.pyx":25 + * TSDB_DATA_TYPE_BOOL, + * TSDB_DATA_TYPE_TINYINT, + * TSDB_DATA_TYPE_SMALLINT, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_INT, + * TSDB_DATA_TYPE_BIGINT, + */ + __pyx_t_4 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_SMALLINT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "taos/_cinterface.pyx":26 + * TSDB_DATA_TYPE_TINYINT, + * TSDB_DATA_TYPE_SMALLINT, + * TSDB_DATA_TYPE_INT, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_BIGINT, + * TSDB_DATA_TYPE_FLOAT, + */ + __pyx_t_5 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_INT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "taos/_cinterface.pyx":27 + * TSDB_DATA_TYPE_SMALLINT, + * TSDB_DATA_TYPE_INT, + * TSDB_DATA_TYPE_BIGINT, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_FLOAT, + * TSDB_DATA_TYPE_DOUBLE, + */ + __pyx_t_6 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BIGINT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "taos/_cinterface.pyx":28 + * TSDB_DATA_TYPE_INT, + * TSDB_DATA_TYPE_BIGINT, + * TSDB_DATA_TYPE_FLOAT, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_DOUBLE, + * TSDB_DATA_TYPE_VARCHAR, + */ + __pyx_t_7 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_FLOAT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "taos/_cinterface.pyx":29 + * TSDB_DATA_TYPE_BIGINT, + * TSDB_DATA_TYPE_FLOAT, + * TSDB_DATA_TYPE_DOUBLE, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_VARCHAR, + * TSDB_DATA_TYPE_UTINYINT, + */ + __pyx_t_8 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "taos/_cinterface.pyx":30 + * TSDB_DATA_TYPE_FLOAT, + * TSDB_DATA_TYPE_DOUBLE, + * TSDB_DATA_TYPE_VARCHAR, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_UTINYINT, + * TSDB_DATA_TYPE_USMALLINT, + */ + __pyx_t_9 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARCHAR); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + + /* "taos/_cinterface.pyx":31 + * TSDB_DATA_TYPE_DOUBLE, + * TSDB_DATA_TYPE_VARCHAR, + * TSDB_DATA_TYPE_UTINYINT, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_USMALLINT, + * TSDB_DATA_TYPE_UINT, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UTINYINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + + /* "taos/_cinterface.pyx":32 + * TSDB_DATA_TYPE_VARCHAR, + * TSDB_DATA_TYPE_UTINYINT, + * TSDB_DATA_TYPE_USMALLINT, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_UINT, + * TSDB_DATA_TYPE_UBIGINT, + */ + __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_USMALLINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + + /* "taos/_cinterface.pyx":33 + * TSDB_DATA_TYPE_UTINYINT, + * TSDB_DATA_TYPE_USMALLINT, + * TSDB_DATA_TYPE_UINT, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_UBIGINT, + * } + */ + __pyx_t_12 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UINT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + + /* "taos/_cinterface.pyx":34 + * TSDB_DATA_TYPE_USMALLINT, + * TSDB_DATA_TYPE_UINT, + * TSDB_DATA_TYPE_UBIGINT, # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_13 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UBIGINT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PySet_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + if (PySet_Add(__pyx_t_14, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_4) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_6) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_7) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_8) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_9) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_10) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_11) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_12) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PySet_Add(__pyx_t_14, __pyx_t_13) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIZED_TYPE, __pyx_t_14) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + + /* "taos/_cinterface.pyx":38 + * + * UNSIZED_TYPE = { + * TSDB_DATA_TYPE_VARCHAR, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_NCHAR, + * TSDB_DATA_TYPE_JSON, + */ + __pyx_t_14 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARCHAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + + /* "taos/_cinterface.pyx":39 + * UNSIZED_TYPE = { + * TSDB_DATA_TYPE_VARCHAR, + * TSDB_DATA_TYPE_NCHAR, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_JSON, + * TSDB_DATA_TYPE_VARBINARY, + */ + __pyx_t_13 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_NCHAR); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + + /* "taos/_cinterface.pyx":40 + * TSDB_DATA_TYPE_VARCHAR, + * TSDB_DATA_TYPE_NCHAR, + * TSDB_DATA_TYPE_JSON, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_VARBINARY, + * TSDB_DATA_TYPE_BINARY, + */ + __pyx_t_12 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_JSON); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + + /* "taos/_cinterface.pyx":41 + * TSDB_DATA_TYPE_NCHAR, + * TSDB_DATA_TYPE_JSON, + * TSDB_DATA_TYPE_VARBINARY, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_BINARY, + * } + */ + __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARBINARY); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + + /* "taos/_cinterface.pyx":42 + * TSDB_DATA_TYPE_JSON, + * TSDB_DATA_TYPE_VARBINARY, + * TSDB_DATA_TYPE_BINARY, # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PySet_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PySet_Add(__pyx_t_9, __pyx_t_14) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (PySet_Add(__pyx_t_9, __pyx_t_13) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PySet_Add(__pyx_t_9, __pyx_t_12) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PySet_Add(__pyx_t_9, __pyx_t_11) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PySet_Add(__pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNSIZED_TYPE, __pyx_t_9) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "taos/_cinterface.pyx":46 + * + * CONVERT_FUNC = { + * TSDB_DATA_TYPE_BOOL: _parse_bool, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_TINYINT: _parse_int8_t, + * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(21); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BOOL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_bool); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "taos/_cinterface.pyx":47 + * CONVERT_FUNC = { + * TSDB_DATA_TYPE_BOOL: _parse_bool, + * TSDB_DATA_TYPE_TINYINT: _parse_int8_t, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, + * TSDB_DATA_TYPE_INT: _parse_int, + */ + __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_TINYINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_int8_t); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":48 + * TSDB_DATA_TYPE_BOOL: _parse_bool, + * TSDB_DATA_TYPE_TINYINT: _parse_int8_t, + * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_INT: _parse_int, + * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_SMALLINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_int16_t); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "taos/_cinterface.pyx":49 + * TSDB_DATA_TYPE_TINYINT: _parse_int8_t, + * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, + * TSDB_DATA_TYPE_INT: _parse_int, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, + * TSDB_DATA_TYPE_FLOAT: _parse_float, + */ + __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_INT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":50 + * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, + * TSDB_DATA_TYPE_INT: _parse_int, + * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_FLOAT: _parse_float, + * TSDB_DATA_TYPE_DOUBLE: _parse_double, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BIGINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_int64_t); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "taos/_cinterface.pyx":51 + * TSDB_DATA_TYPE_INT: _parse_int, + * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, + * TSDB_DATA_TYPE_FLOAT: _parse_float, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_DOUBLE: _parse_double, + * TSDB_DATA_TYPE_VARCHAR: None, + */ + __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_FLOAT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_float); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":52 + * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, + * TSDB_DATA_TYPE_FLOAT: _parse_float, + * TSDB_DATA_TYPE_DOUBLE: _parse_double, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_VARCHAR: None, + * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_DOUBLE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_double); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "taos/_cinterface.pyx":53 + * TSDB_DATA_TYPE_FLOAT: _parse_float, + * TSDB_DATA_TYPE_DOUBLE: _parse_double, + * TSDB_DATA_TYPE_VARCHAR: None, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, + * TSDB_DATA_TYPE_NCHAR: None, + */ + __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARCHAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "taos/_cinterface.pyx":54 + * TSDB_DATA_TYPE_DOUBLE: _parse_double, + * TSDB_DATA_TYPE_VARCHAR: None, + * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_NCHAR: None, + * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, + */ + __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_TIMESTAMP); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(__pyx_f_4taos_7_parser__parse_timestamp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":55 + * TSDB_DATA_TYPE_VARCHAR: None, + * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, + * TSDB_DATA_TYPE_NCHAR: None, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, + * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_NCHAR); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":56 + * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, + * TSDB_DATA_TYPE_NCHAR: None, + * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, + * TSDB_DATA_TYPE_UINT: _parse_uint, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UTINYINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_uint8_t); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "taos/_cinterface.pyx":57 + * TSDB_DATA_TYPE_NCHAR: None, + * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, + * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_UINT: _parse_uint, + * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, + */ + __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_USMALLINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_uint16_t); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":58 + * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, + * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, + * TSDB_DATA_TYPE_UINT: _parse_uint, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, + * TSDB_DATA_TYPE_JSON: None, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_uint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "taos/_cinterface.pyx":59 + * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, + * TSDB_DATA_TYPE_UINT: _parse_uint, + * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_JSON: None, + * TSDB_DATA_TYPE_VARBINARY: None, + */ + __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UBIGINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_uint64_t); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":60 + * TSDB_DATA_TYPE_UINT: _parse_uint, + * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, + * TSDB_DATA_TYPE_JSON: None, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_VARBINARY: None, + * TSDB_DATA_TYPE_DECIMAL: None, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_JSON); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":61 + * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, + * TSDB_DATA_TYPE_JSON: None, + * TSDB_DATA_TYPE_VARBINARY: None, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_DECIMAL: None, + * TSDB_DATA_TYPE_BLOB: None, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARBINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":62 + * TSDB_DATA_TYPE_JSON: None, + * TSDB_DATA_TYPE_VARBINARY: None, + * TSDB_DATA_TYPE_DECIMAL: None, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_BLOB: None, + * TSDB_DATA_TYPE_MEDIUMBLOB: None, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_DECIMAL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":63 + * TSDB_DATA_TYPE_VARBINARY: None, + * TSDB_DATA_TYPE_DECIMAL: None, + * TSDB_DATA_TYPE_BLOB: None, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_MEDIUMBLOB: None, + * TSDB_DATA_TYPE_BINARY: None, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BLOB); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":64 + * TSDB_DATA_TYPE_DECIMAL: None, + * TSDB_DATA_TYPE_BLOB: None, + * TSDB_DATA_TYPE_MEDIUMBLOB: None, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_BINARY: None, + * TSDB_DATA_TYPE_GEOMETRY: None, + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_MEDIUMBLOB); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":65 + * TSDB_DATA_TYPE_BLOB: None, + * TSDB_DATA_TYPE_MEDIUMBLOB: None, + * TSDB_DATA_TYPE_BINARY: None, # <<<<<<<<<<<<<< + * TSDB_DATA_TYPE_GEOMETRY: None, + * } + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "taos/_cinterface.pyx":66 + * TSDB_DATA_TYPE_MEDIUMBLOB: None, + * TSDB_DATA_TYPE_BINARY: None, + * TSDB_DATA_TYPE_GEOMETRY: None, # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_GEOMETRY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONVERT_FUNC, __pyx_t_9) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "taos/_cinterface.pyx":98 + * return blocks, abs(num_of_rows) + * + * cpdef fetch_all(size_t ptr, dt_epoch): # <<<<<<<<<<<<<< + * res = ptr + * fields = taos_fetch_fields(res) + */ + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_11_cinterface_1fetch_all, 0, __pyx_n_s_fetch_all, NULL, __pyx_n_s_taos__cinterface, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fetch_all, __pyx_t_9) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "taos/_cinterface.pyx":1 + * # cython: profile=True # <<<<<<<<<<<<<< + * + * import cython + */ + __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_9) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_TraceReturn(Py_None, 0); + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init taos._cinterface", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init taos._cinterface"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; // error + return kwvalues[i]; + } + } + return NULL; // not found (no exception set) +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + if (kwds_is_tuple) { + if (pos >= PyTuple_GET_SIZE(kwds)) break; + key = PyTuple_GET_ITEM(kwds, pos); + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); + if (unlikely(!abi_module)) return NULL; + Py_INCREF(abi_module); + return abi_module; +} + +/* FetchCommonType */ +static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); + PyList_SET_ITEM(fromlist, 0, marker); + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyCFunctionObject *cf = (PyCFunctionObject*) op; + if (unlikely(op == NULL)) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + cf->m_ml = ml; + cf->m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + cf->m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(((PyCFunctionObject*)m)->m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(((PyCFunctionObject*)m)->m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#ifdef _Py_TPFLAGS_HAVE_VECTORCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* PyIntCompare */ +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(inplace); + if (op1 == op2) { + return 1; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + return (a == b); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + if (intval == 0) { + return (__Pyx_PyLong_IsZero(op1) == 1); + } else if (intval < 0) { + if (__Pyx_PyLong_IsNonNeg(op1)) + return 0; + intval = -intval; + } else { + if (__Pyx_PyLong_IsNeg(op1)) + return 0; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + return (unequal == 0); + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + return ((double)a == (double)b); + } + return __Pyx_PyObject_IsTrueAndDecref( + PyObject_RichCompare(op1, op2, Py_EQ)); +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* SetItemInt */ +static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (unlikely(!j)) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, + CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_ass_subscript) { + int r; + PyObject *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return -1; + r = mm->mp_ass_subscript(o, key, v); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return -1; + PyErr_Clear(); + } + } + return sm->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) +#else + if (is_list || PySequence_Check(o)) +#endif + { + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]); + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + Py_DECREF(argstuple); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) + if (__Pyx_IsCyOrPyCFunction(func)) +#else + if (PyCFunction_Check(func)) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + } + else if (nargs == 1 && kwargs == NULL) { + if (PyCFunction_Check(func)) + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, args[0]); + } + } + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + #if CYTHON_VECTORCALL + vectorcallfunc f = _PyVectorcall_Function(func); + if (f) { + return f(func, args, (size_t)nargs, kwargs); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, kwargs); + } + #endif + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); +} + +/* py_abs */ +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { +#if PY_VERSION_HEX >= 0x030C00A7 + if (likely(__Pyx_PyLong_IsCompact(n))) { + return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n)); + } +#else + if (likely(Py_SIZE(n) == -1)) { + return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]); + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *copy = _PyLong_Copy((PyLongObject*)n); + if (likely(copy)) { + #if PY_VERSION_HEX >= 0x030C00A7 + ((PyLongObject*)copy)->long_value.lv_tag = ((PyLongObject*)copy)->long_value.lv_tag & ~_PyLong_SIGN_MASK; + #else + __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); + #endif + } + return copy; + } +#else + return PyNumber_Negative(n); +#endif +} +#endif + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return -1; + __Pyx_PyErr_Clear(); + return 0; + } + return 0; +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } + return __Pyx_IterFinish(); +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg = NULL; + return __Pyx_PyObject_FastCall(func, (&arg)+1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + __Pyx_TypeName type_name; + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR + if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) +#elif PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (likely(descr != NULL)) { + *method = descr; + return 0; + } + type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* ValidateBasesTuple */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { + Py_ssize_t i, n = PyTuple_GET_SIZE(bases); + for (i = 1; i < n; i++) + { + PyObject *b0 = PyTuple_GET_ITEM(bases, i); + PyTypeObject *b; +#if PY_MAJOR_VERSION < 3 + if (PyClass_Check(b0)) + { + PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", + PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); + return -1; + } +#endif + b = (PyTypeObject*) b0; + if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); + __Pyx_DECREF_TypeName(b_name); + return -1; + } + if (dictoffset == 0 && b->tp_dictoffset) + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + return -1; + } + } + return 0; +} +#endif + +/* PyType_Ready */ +static int __Pyx_PyType_Ready(PyTypeObject *t) { +#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) + (void)__Pyx_PyObject_CallMethod0; +#if CYTHON_USE_TYPE_SPECS + (void)__Pyx_validate_bases_tuple; +#endif + return PyType_Ready(t); +#else + int r; + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) + return -1; +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + { + int gc_was_enabled; + #if PY_VERSION_HEX >= 0x030A00b1 + gc_was_enabled = PyGC_Disable(); + (void)__Pyx_PyObject_CallMethod0; + #else + PyObject *ret, *py_status; + PyObject *gc = NULL; + #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) + gc = PyImport_GetModule(__pyx_kp_u_gc); + #endif + if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) return -1; + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + if (unlikely(!py_status)) { + Py_DECREF(gc); + return -1; + } + gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); + Py_DECREF(py_status); + if (gc_was_enabled > 0) { + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + if (unlikely(!ret)) { + Py_DECREF(gc); + return -1; + } + Py_DECREF(ret); + } else if (unlikely(gc_was_enabled == -1)) { + Py_DECREF(gc); + return -1; + } + #endif + t->tp_flags |= Py_TPFLAGS_HEAPTYPE; +#if PY_VERSION_HEX >= 0x030A0000 + t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; +#endif +#else + (void)__Pyx_PyObject_CallMethod0; +#endif + r = PyType_Ready(t); +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; + #if PY_VERSION_HEX >= 0x030A00b1 + if (gc_was_enabled) + PyGC_Enable(); + #else + if (gc_was_enabled) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + if (likely(ret || r == -1)) { + Py_XDECREF(ret); + PyErr_Restore(tp, v, tb); + } else { + Py_XDECREF(tp); + Py_XDECREF(v); + Py_XDECREF(tb); + r = -1; + } + } + Py_DECREF(gc); + #endif + } +#endif + return r; +#endif +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, attr_name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(attr_name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, 1); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + #endif + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportDottedModule */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s__6; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__7); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + _PyTraceback_Add(funcname, filename, py_line); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(size_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(size_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(size_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (size_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (size_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (size_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (size_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((size_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((size_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int8_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int8_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int8_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int8_t), + little, !is_unsigned); + } +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__9)); + } + return name; +} +#endif + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i '9'); + break; + } + if (rt_from_call[i] != ctversion[i]) { + same = 0; + break; + } + } + if (!same) { + char rtversion[5] = {'\0'}; + char message[200]; + for (i=0; i<4; ++i) { + if (rt_from_call[i] == '.') { + if (found_dot) break; + found_dot = 1; + } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { + break; + } + rtversion[i] = rt_from_call[i]; + } + PyOS_snprintf(message, sizeof(message), + "compile time version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; + cobj = PyCapsule_New(tmp.p, sig, 0); + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction_3_0_0 +#define __PYX_HAVE_RT_ImportFunction_3_0_0 +static int __Pyx_ImportFunction_3_0_0(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 2dccf3e7..eba97cf7 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -88,5 +88,55 @@ cdef extern from "taos.h": int taos_get_table_vgId(TAOS *taos, const char *db, const char *table, int *vgId) int taos_load_table_info(TAOS *taos, const char *tableNameList) + ctypedef struct tmq_t: + pass + + ctypedef struct tmq_conf_t: + pass + + ctypedef struct tmq_list_t: + pass + + ctypedef enum tmq_conf_res_t: + TMQ_CONF_UNKNOWN + TMQ_CONF_INVALID + TMQ_CONF_OK + + ctypedef struct tmq_topic_assignment: + int32_t vgId + int64_t currentOffset + int64_t begin + int64_t end + + tmq_conf_t *tmq_conf_new() + tmq_conf_res_t tmq_conf_set(tmq_conf_t *conf, const char *key, const char *value) + void tmq_conf_destroy(tmq_conf_t *conf) + + tmq_list_t *tmq_list_new() + int32_t tmq_list_append(tmq_list_t *, const char *) + void tmq_list_destroy(tmq_list_t *) + int32_t tmq_list_get_size(const tmq_list_t *) + char **tmq_list_to_c_array(const tmq_list_t *) + + tmq_t *tmq_consumer_new(tmq_conf_t *conf, char *errstr, int32_t errstrLen) + int32_t tmq_subscribe(tmq_t *tmq, const tmq_list_t *topic_list) + int32_t tmq_unsubscribe(tmq_t *tmq) + TAOS_RES *tmq_consumer_poll(tmq_t *tmq, int64_t timeout) + int32_t tmq_consumer_close(tmq_t *tmq) + int32_t tmq_commit_sync(tmq_t *tmq, const TAOS_RES *msg) + int32_t tmq_commit_offset_sync(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset) + int32_t tmq_get_topic_assignment(tmq_t *tmq, const char *pTopicName, tmq_topic_assignment **assignment,int32_t *numOfAssignment) + void tmq_free_assignment(tmq_topic_assignment* pAssignment) + int32_t tmq_offset_seek(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset) + int64_t tmq_position(tmq_t *tmq, const char *pTopicName, int32_t vgId) + int64_t tmq_committed(tmq_t *tmq, const char *pTopicName, int32_t vgId) + + const char *tmq_get_topic_name(TAOS_RES *res) + const char *tmq_get_db_name(TAOS_RES *res) + int32_t tmq_get_vgroup_id(TAOS_RES *res) + int64_t tmq_get_vgroup_offset(TAOS_RES* res) + const char *tmq_err2str(int32_t code) + + cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows) -cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch) +cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, object dt_epoch) diff --git a/taos/_cinterface.pyx b/taos/_cinterface.pyx index 516deabb..bc7b9b76 100644 --- a/taos/_cinterface.pyx +++ b/taos/_cinterface.pyx @@ -5,20 +5,8 @@ import datetime as dt import pytz from collections import namedtuple from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError -from taos._parser cimport * - -cpdef print_type_size(): - print("bool:", sizeof(bool)) - print("int8_t", sizeof(int8_t)) - print("int16_t", sizeof(int16_t)) - print("int32_t", sizeof(int32_t)) - print("int64_t", sizeof(int64_t)) - print("uint8_t", sizeof(uint8_t)) - print("uint16_t", sizeof(uint16_t)) - print("uint32_t", sizeof(uint32_t)) - print("uint64_t", sizeof(uint64_t)) - print("int", sizeof(int)) - print("uint", sizeof(unsigned int)) +from taos._parser cimport (_parse_bool, _parse_int8_t, _parse_int16_t, _parse_int, _parse_int64_t, _parse_float, _parse_double, _parse_timestamp, + _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string) cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): cdef list is_null = [] diff --git a/taos/_objects.c b/taos/_objects.c new file mode 100644 index 00000000..e572ca91 --- /dev/null +++ b/taos/_objects.c @@ -0,0 +1,33552 @@ +/* Generated by Cython 3.0.0 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "C:\\TDengine\\include\\taos.h" + ], + "include_dirs": [ + "C:\\TDengine\\include" + ], + "libraries": [ + "taos" + ], + "library_dirs": [ + "C:\\TDengine\\driver" + ], + "name": "taos._objects", + "sources": [ + "taos/_objects.pyx" + ] + }, + "module_name": "taos._objects" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#define CYTHON_ABI "3_0_0" +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030000F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PY_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject *co=NULL, *result=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(p))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; + if (!(empty = PyTuple_New(0))) goto end; + result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); + end: + Py_XDECREF((PyObject*) co); + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE(obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__taos___objects +#define __PYX_HAVE_API__taos___objects +/* Early includes */ +#include +#include "taos.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else // Py < 3.12 + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "taos\\\\_objects.pyx", + "", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +struct __pyx_obj_4taos_8_objects_TaosConnection; +struct __pyx_obj_4taos_8_objects_TaosField; +struct __pyx_obj_4taos_8_objects_TaosResult; +struct __pyx_obj_4taos_8_objects_TaosCursor; +struct __pyx_obj_4taos_8_objects_TaosTopicAssignment; +struct __pyx_obj_4taos_8_objects_TaosConsumer; +struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter; +struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter; +struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__; + +/* "taos/_objects.pyx":46 + * + * + * cdef class TaosConnection: # <<<<<<<<<<<<<< + * cdef char *_host + * cdef char *_user + */ +struct __pyx_obj_4taos_8_objects_TaosConnection { + PyObject_HEAD + char *_host; + char *_user; + char *_password; + char *_database; + uint16_t _port; + char *_tz; + char *_config; + TAOS *_raw_conn; +}; + + +/* "taos/_objects.pyx":195 + * + * + * cdef class TaosField: # <<<<<<<<<<<<<< + * cdef str _name + * cdef int8_t _type + */ +struct __pyx_obj_4taos_8_objects_TaosField { + PyObject_HEAD + PyObject *_name; + int8_t _type; + int32_t _bytes; +}; + + +/* "taos/_objects.pyx":231 + * + * + * cdef class TaosResult: # <<<<<<<<<<<<<< + * cdef TAOS_RES *_res + * cdef TAOS_FIELD *_fields + */ +struct __pyx_obj_4taos_8_objects_TaosResult { + PyObject_HEAD + TAOS_RES *_res; + TAOS_FIELD *_fields; + int _field_count; + int _precision; + int _row_count; + int _affected_rows; +}; + + +/* "taos/_objects.pyx":413 + * + * + * cdef class TaosCursor: # <<<<<<<<<<<<<< + * cdef list _description + * cdef TaosConnection _connection + */ +struct __pyx_obj_4taos_8_objects_TaosCursor { + PyObject_HEAD + PyObject *_description; + struct __pyx_obj_4taos_8_objects_TaosConnection *_connection; + struct __pyx_obj_4taos_8_objects_TaosResult *_result; +}; + + +/* "taos/_objects.pyx":475 + * + * + * cdef class TaosTopicAssignment: # <<<<<<<<<<<<<< + * cdef int32_t _vg_id + * cdef int64_t _current_offset + */ +struct __pyx_obj_4taos_8_objects_TaosTopicAssignment { + PyObject_HEAD + int32_t _vg_id; + int64_t _current_offset; + int64_t _begin; + int64_t _end; +}; + + +/* "taos/_objects.pyx":504 + * + * + * cdef class TaosConsumer: # <<<<<<<<<<<<<< + * cdef dict _configs + * cdef tmq_conf_t *_tmq_conf + */ +struct __pyx_obj_4taos_8_objects_TaosConsumer { + PyObject_HEAD + PyObject *_configs; + tmq_conf_t *_tmq_conf; + tmq_t *_tmq; +}; + + +/* "taos/_objects.pyx":355 + * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] + * + * def rows_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ +struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter { + PyObject_HEAD + void *__pyx_v_data; + PyObject *__pyx_v_dt_epoch; + TAOS_FIELD __pyx_v_field; + int __pyx_v_i; + PyObject *__pyx_v_is_null; + PyObject *__pyx_v_row; + struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self; + TAOS_ROW __pyx_v_taos_row; +}; + + +/* "taos/_objects.pyx":387 + * yield row + * + * def blocks_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ +struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter { + PyObject_HEAD + PyObject *__pyx_v_block; + PyObject *__pyx_v_num_of_rows; + PyObject *__pyx_8genexpr6__pyx_v_r; + struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self; +}; + + +/* "taos/_objects.pyx":423 + * self._result = None + * + * def __iter__(self): # <<<<<<<<<<<<<< + * for block, num_of_rows in self._result.blocks_iter(): + * for row in block: + */ +struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ { + PyObject_HEAD + PyObject *__pyx_v_block; + PyObject *__pyx_v_num_of_rows; + PyObject *__pyx_v_row; + struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self; + PyObject *__pyx_t_0; + PyObject *__pyx_t_1; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); +}; + +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* Profile.proto */ +#ifndef CYTHON_PROFILE +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + #define CYTHON_PROFILE 0 +#else + #define CYTHON_PROFILE 1 +#endif +#endif +#ifndef CYTHON_TRACE_NOGIL + #define CYTHON_TRACE_NOGIL 0 +#else + #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) + #define CYTHON_TRACE 1 + #endif +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL(frame) + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) + #endif + #define __Pyx_TraceDeclarations\ + static PyCodeObject *__pyx_frame_code = NULL;\ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceFrameInit(codeobj)\ + if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; +#if PY_VERSION_HEX >= 0x030b00a2 + #if PY_VERSION_HEX >= 0x030C00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + ((!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #endif + #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) + #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) +#elif PY_VERSION_HEX >= 0x030a00b1 + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->cframe->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#else + #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ + (unlikely((tstate)->use_tracing) &&\ + (!(check_tracing) || !(tstate)->tracing) &&\ + (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) + #define __Pyx_EnterTracing(tstate)\ + do { tstate->tracing++; tstate->use_tracing = 0; } while (0) + #define __Pyx_LeaveTracing(tstate)\ + do {\ + tstate->tracing--;\ + tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ + || tstate->c_profilefunc != NULL);\ + } while (0) +#endif + #ifdef WITH_THREAD + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + }\ + PyGILState_Release(state);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #else + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ + { PyThreadState* tstate = PyThreadState_GET();\ + if (__Pyx_IsTracing(tstate, 1, 1)) {\ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ + if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ + }\ + } + #endif + #define __Pyx_TraceException()\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 1)) {\ + __Pyx_EnterTracing(tstate);\ + PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ + if (exc_info) {\ + if (CYTHON_TRACE && tstate->c_tracefunc)\ + tstate->c_tracefunc(\ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + tstate->c_profilefunc(\ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ + Py_DECREF(exc_info);\ + }\ + __Pyx_LeaveTracing(tstate);\ + }\ + } + static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_EnterTracing(tstate); + if (CYTHON_TRACE && tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); + if (tstate->c_profilefunc) + tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); + CYTHON_FRAME_DEL(frame); + __Pyx_LeaveTracing(tstate); + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } + #ifdef WITH_THREAD + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + PyThreadState *tstate;\ + PyGILState_STATE state = PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + PyGILState_Release(state);\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + }\ + } + #else + #define __Pyx_TraceReturn(result, nogil)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0)) {\ + __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ + }\ + } + #endif + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceFrameInit(codeobj) + #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result, nogil) +#endif +#if CYTHON_TRACE + static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { + int ret; + PyObject *type, *value, *traceback; + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + __Pyx_PyFrame_SetLineNumber(frame, lineno); + __Pyx_EnterTracing(tstate); + ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); + __Pyx_LeaveTracing(tstate); + if (likely(!ret)) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + } + return ret; + } + #ifdef WITH_THREAD + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + if (nogil) {\ + if (CYTHON_TRACE_NOGIL) {\ + int ret = 0;\ + PyThreadState *tstate;\ + PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ + tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + }\ + __Pyx_PyGILState_Release(state);\ + if (unlikely(ret)) goto_error;\ + }\ + } else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + }\ + } + #else + #define __Pyx_TraceLine(lineno, nogil, goto_error)\ + if (likely(!__Pyx_use_tracing)); else {\ + PyThreadState* tstate = __Pyx_PyThreadState_Current;\ + if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ + int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ + if (unlikely(ret)) goto_error;\ + }\ + } + #endif +#else + #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; +#endif + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_bytes.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( + const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* decode_bytes.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_bytes( + PyObject* string, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + return __Pyx_decode_c_bytes( + PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string), + start, stop, encoding, errors, decode_func); +} + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* UnpackTupleError.proto */ +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); + +/* UnpackTuple2.proto */ +#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ + (likely(is_tuple || PyTuple_Check(tuple)) ?\ + (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ + __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ + (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ + __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); +static int __Pyx_unpack_tuple2_generic( + PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); + +/* dict_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +/* PyObjectFormatAndDecref.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* BuildPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char); + +/* CIntToPyUnicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char); + +/* PyIntCompare.proto */ +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* SetItemInt.proto */ +#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ + __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) +static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, + int is_list, int wraparound, int boundscheck); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* py_abs.proto */ +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); +#define __Pyx_PyNumber_Absolute(x)\ + ((likely(PyLong_CheckExact(x))) ?\ + (likely(__Pyx_PyLong_IsNonNeg(x)) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ + PyNumber_Absolute(x)) +#else +#define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* pep479.proto */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* IterNext.proto */ +#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* RaiseUnexpectedTypeError.proto */ +static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* ValidateBasesTuple.proto */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); +#endif + +/* PyType_Ready.proto */ +CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetupReduce.proto */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_setup_reduce(PyObject* type_obj); +#endif + +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int8_t __Pyx_PyInt_As_int8_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* CoroutineBase.proto */ +struct __pyx_CoroutineObject; +typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_ExcInfoStruct _PyErr_StackItem +#else +typedef struct { + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; +} __Pyx_ExcInfoStruct; +#endif +typedef struct __pyx_CoroutineObject { + PyObject_HEAD + __pyx_coroutine_body_t body; + PyObject *closure; + __Pyx_ExcInfoStruct gi_exc_state; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + PyObject *gi_name; + PyObject *gi_qualname; + PyObject *gi_modulename; + PyObject *gi_code; + PyObject *gi_frame; + int resume_label; + char is_running; +} __pyx_CoroutineObject; +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); +static int __Pyx_Coroutine_clear(PyObject *self); +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_Coroutine_SwapException(self) +#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) +#else +#define __Pyx_Coroutine_SwapException(self) {\ + __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ + __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ + } +#define __Pyx_Coroutine_ResetAndClearException(self) {\ + __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ + (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ + } +#endif +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) +#endif +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); + +/* PatchModuleWithCoroutine.proto */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); + +/* PatchGeneratorABC.proto */ +static int __Pyx_patch_abc(void); + +/* Generator.proto */ +#define __Pyx_Generator_USED +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ + __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) +static PyObject *__Pyx_Generator_Next(PyObject *self); +static int __pyx_Generator_init(PyObject *module); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction_3_0_0(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "libc.stdint" */ + +/* Module declarations from "libcpp" */ + +/* Module declarations from "taos._cinterface" */ +static PyObject *(*__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null)(TAOS_RES *, int, int); /*proto*/ +static PyObject *(*__pyx_f_4taos_11_cinterface_taos_fetch_block_v3)(TAOS_RES *, TAOS_FIELD *, int, PyObject *); /*proto*/ + +/* Module declarations from "taos._parser" */ +static PyObject *(*__pyx_f_4taos_7_parser__parse_binary_string)(size_t, int, int); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_nchar_string)(size_t, int, int); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_string)(size_t, int, int *); /*proto*/ +static PyObject *(*__pyx_f_4taos_7_parser__parse_timestamp)(size_t, int, PyObject *, int, PyObject *); /*proto*/ + +/* Module declarations from "taos._objects" */ +static void __pyx_f_4taos_8_objects_async_callback_wrapper(void *, TAOS_RES *, int); /*proto*/ +static PyObject *__pyx_f_4taos_8_objects___pyx_unpickle_TaosCursor__set_state(struct __pyx_obj_4taos_8_objects_TaosCursor *, PyObject *); /*proto*/ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "taos._objects" +extern int __pyx_module_is_main_taos___objects; +int __pyx_module_is_main_taos___objects = 0; + +/* Implementation of "taos._objects" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_OSError; +static PyObject *__pyx_builtin_print; +static PyObject *__pyx_builtin_map; +static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_range; +/* #### Code section: string_decls ### */ +static const char __pyx_k_b[] = "b"; +static const char __pyx_k_d[] = "d"; +static const char __pyx_k_f[] = "f"; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k_k[] = "k"; +static const char __pyx_k_r[] = "r"; +static const char __pyx_k_v[] = "v"; +static const char __pyx_k_db[] = "db"; +static const char __pyx_k_dt[] = "dt"; +static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_tp[] = "tp"; +static const char __pyx_k_tz[] = "tz"; +static const char __pyx_k_UTC[] = "UTC"; +static const char __pyx_k__12[] = ","; +static const char __pyx_k__19[] = "}"; +static const char __pyx_k__63[] = "."; +static const char __pyx_k__64[] = "*"; +static const char __pyx_k_end[] = "end"; +static const char __pyx_k_int[] = "int"; +static const char __pyx_k_k_2[] = "_k"; +static const char __pyx_k_map[] = "map"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_pos[] = "pos"; +static const char __pyx_k_res[] = "res"; +static const char __pyx_k_row[] = "row"; +static const char __pyx_k_sql[] = "sql"; +static const char __pyx_k_str[] = "str"; +static const char __pyx_k_tta[] = "tta"; +static const char __pyx_k_v_2[] = "_v"; +static const char __pyx_k_zip[] = "zip"; +static const char __pyx_k__101[] = "?"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_code[] = "code"; +static const char __pyx_k_data[] = "data"; +static const char __pyx_k_db_2[] = "_db"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_host[] = "host"; +static const char __pyx_k_iter[] = "__iter__"; +static const char __pyx_k_list[] = "list"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_poll[] = "poll"; +static const char __pyx_k_port[] = "port"; +static const char __pyx_k_pytz[] = "pytz"; +static const char __pyx_k_root[] = "root"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_send[] = "send"; +static const char __pyx_k_spec[] = "__spec__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_tp_2[] = "_tp"; +static const char __pyx_k_type[] = "type_"; +static const char __pyx_k_user[] = "user"; +static const char __pyx_k_begin[] = "begin"; +static const char __pyx_k_block[] = "block"; +static const char __pyx_k_bytes[] = "bytes"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_errno[] = "errno"; +static const char __pyx_k_field[] = "field"; +static const char __pyx_k_items[] = "items"; +static const char __pyx_k_print[] = "print"; +static const char __pyx_k_query[] = "query"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_sql_2[] = "_sql"; +static const char __pyx_k_state[] = "state"; +static const char __pyx_k_table[] = "table"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_topic[] = "topic"; +static const char __pyx_k_utf_8[] = "utf-8"; +static const char __pyx_k_vg_id[] = "vg_id"; +static const char __pyx_k_asdict[] = "_asdict"; +static const char __pyx_k_blocks[] = "blocks"; +static const char __pyx_k_commit[] = "commit"; +static const char __pyx_k_config[] = "config"; +static const char __pyx_k_decode[] = "decode"; +static const char __pyx_k_dict_2[] = "_dict"; +static const char __pyx_k_enable[] = "enable"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_errstr[] = "errstr"; +static const char __pyx_k_fields[] = "fields"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_offset[] = "offset"; +static const char __pyx_k_params[] = "params"; +static const char __pyx_k_pblock[] = "pblock"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_req_id[] = "req_id"; +static const char __pyx_k_set_tz[] = "set_tz"; +static const char __pyx_k_tables[] = "tables"; +static const char __pyx_k_topics[] = "topics"; +static const char __pyx_k_type_2[] = ", type: "; +static const char __pyx_k_type_3[] = "type"; +static const char __pyx_k_typing[] = "typing"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_utc_tz[] = "_utc_tz"; +static const char __pyx_k_DictRow[] = "DictRow"; +static const char __pyx_k_OSError[] = "OSError"; +static const char __pyx_k_bytes_2[] = ", bytes: "; +static const char __pyx_k_configs[] = "configs"; +static const char __pyx_k_disable[] = "disable"; +static const char __pyx_k_execute[] = "execute"; +static const char __pyx_k_is_null[] = "is_null"; +static const char __pyx_k_offsets[] = "offsets"; +static const char __pyx_k_priv_tz[] = "_priv_tz"; +static const char __pyx_k_query_a[] = "query_a"; +static const char __pyx_k_seconds[] = "seconds"; +static const char __pyx_k_table_2[] = "_table"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_topic_2[] = "_topic"; +static const char __pyx_k_Optional[] = "Optional"; +static const char __pyx_k_TmqError[] = "TmqError"; +static const char __pyx_k_callback[] = "callback:"; +static const char __pyx_k_database[] = "database"; +static const char __pyx_k_datetime[] = "datetime"; +static const char __pyx_k_dt_epoch[] = "dt_epoch"; +static const char __pyx_k_fetchall[] = "fetchall"; +static const char __pyx_k_fetchone[] = "fetchone"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_list_str[] = "list[str]"; +static const char __pyx_k_localize[] = "localize"; +static const char __pyx_k_password[] = "password"; +static const char __pyx_k_position[] = "position"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_rollback[] = "rollback"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_tables_2[] = "_tables"; +static const char __pyx_k_taos_res[] = "taos_res"; +static const char __pyx_k_taos_row[] = "taos_row"; +static const char __pyx_k_taosdata[] = "taosdata"; +static const char __pyx_k_timezone[] = "timezone"; +static const char __pyx_k_tmq_conf[] = "tmq_conf"; +static const char __pyx_k_tmq_list[] = "tmq_list"; +static const char __pyx_k_TaosField[] = "TaosField"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_committed[] = "committed"; +static const char __pyx_k_fetch_all[] = "fetch_all"; +static const char __pyx_k_init_conn[] = "_init_conn"; +static const char __pyx_k_isenabled[] = "isenabled"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_row_count[] = "row_count"; +static const char __pyx_k_rows_iter[] = "rows_iter"; +static const char __pyx_k_select_db[] = "select_db"; +static const char __pyx_k_subscribe[] = "subscribe"; +static const char __pyx_k_timedelta[] = "timedelta"; +static const char __pyx_k_tmq_errno[] = "tmq_errno"; +static const char __pyx_k_SIZED_TYPE[] = "SIZED_TYPE"; +static const char __pyx_k_TaosCursor[] = "TaosCursor"; +static const char __pyx_k_TaosResult[] = "TaosResult"; +static const char __pyx_k_assignment[] = "assignment"; +static const char __pyx_k_astimezone[] = "astimezone"; +static const char __pyx_k_callback_2[] = "callback"; +static const char __pyx_k_connection[] = "connection"; +static const char __pyx_k_database_2[] = "_database"; +static const char __pyx_k_namedtuple[] = "namedtuple"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_taos_error[] = "taos.error"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_blocks_iter[] = "blocks_iter"; +static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_fetch_block[] = "_fetch_block"; +static const char __pyx_k_field_names[] = "field_names"; +static const char __pyx_k_get_db_name[] = "get_db_name"; +static const char __pyx_k_num_of_rows[] = "num_of_rows"; +static const char __pyx_k_offset_seek[] = "offset_seek"; +static const char __pyx_k_unsubscribe[] = "unsubscribe"; +static const char __pyx_k_CONVERT_FUNC[] = "CONVERT_FUNC"; +static const char __pyx_k_Optional_int[] = "Optional[int]"; +static const char __pyx_k_TaosConsumer[] = "TaosConsumer"; +static const char __pyx_k_UNSIZED_TYPE[] = "UNSIZED_TYPE"; +static const char __pyx_k_dict_row_cls[] = "dict_row_cls"; +static const char __pyx_k_dict_str_str[] = "dict[str, str]"; +static const char __pyx_k_fetch_rows_a[] = "fetch_rows_a"; +static const char __pyx_k_init_options[] = "_init_options"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_reset_result[] = "_reset_result"; +static const char __pyx_k_stringsource[] = ""; +static const char __pyx_k_tmq_conf_res[] = "tmq_conf_res:"; +static const char __pyx_k_use_setstate[] = "use_setstate"; +static const char __pyx_k_DatabaseError[] = "DatabaseError"; +static const char __pyx_k_InternalError[] = "InternalError"; +static const char __pyx_k_affected_rows[] = "affected_rows"; +static const char __pyx_k_fetch_block_2[] = "fetch_block"; +static const char __pyx_k_fromtimestamp[] = "fromtimestamp"; +static const char __pyx_k_get_vgroup_id[] = "get_vgroup_id"; +static const char __pyx_k_offset_commit[] = "offset_commit"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_result_commit[] = "result_commit"; +static const char __pyx_k_taos__objects[] = "taos._objects"; +static const char __pyx_k_StatementError[] = "StatementError"; +static const char __pyx_k_TaosConnection[] = "TaosConnection"; +static const char __pyx_k_TaosField_name[] = "TaosField{name: "; +static const char __pyx_k_TaosResult_res[] = "TaosResult{res: "; + static const char __pyx_k_assignment_ptr[] = "assignment_ptr"; + static const char __pyx_k_current_offset[] = "current_offset"; + static const char __pyx_k_datetime_epoch[] = "_datetime_epoch"; + static const char __pyx_k_get_topic_name[] = "get_topic_name"; + static const char __pyx_k_tmq_conf_res_2[] = "tmq_conf_res"; + static const char __pyx_k_ConnectionError[] = "ConnectionError"; + static const char __pyx_k_load_table_info[] = "load_table_info"; + static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; + static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; + static const char __pyx_k_OperationalError[] = "OperationalError"; + static const char __pyx_k_ProgrammingError[] = "ProgrammingError"; + static const char __pyx_k_TaosCursor_close[] = "TaosCursor.close"; + static const char __pyx_k_check_conn_error[] = "_check_conn_error"; + static const char __pyx_k_clear_result_set[] = "clear_result_set"; + static const char __pyx_k_setup_tmq_failed[] = "setup tmq failed"; + static const char __pyx_k_taos__cinterface[] = "taos._cinterface"; + static const char __pyx_k_utcfromtimestamp[] = "utcfromtimestamp"; + static const char __pyx_k_TaosConsumer_poll[] = "TaosConsumer.poll"; + static const char __pyx_k_TaosCursor___iter[] = "TaosCursor.__iter__"; + static const char __pyx_k_get_vgroup_offset[] = "get_vgroup_offset"; + static const char __pyx_k_num_of_assignment[] = "num_of_assignment"; + static const char __pyx_k_taos__objects_pyx[] = "taos\\_objects.pyx"; + static const char __pyx_k_topic_assignments[] = "topic_assignments"; + static const char __pyx_k_TaosCursor_execute[] = "TaosCursor.execute"; + static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; + static const char __pyx_k_check_result_error[] = "_check_result_error"; + static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; + static const char __pyx_k_utc_datetime_epoch[] = "_utc_datetime_epoch"; + static const char __pyx_k_TaosConsumer_commit[] = "TaosConsumer.commit"; + static const char __pyx_k_TaosCursor_fetchall[] = "TaosCursor.fetchall"; + static const char __pyx_k_TaosCursor_fetchone[] = "TaosCursor.fetchone"; + static const char __pyx_k_TaosTopicAssignment[] = "TaosTopicAssignment"; + static const char __pyx_k_fetch_all_into_dict[] = "fetch_all_into_dict"; + static const char __pyx_k_get_table_vgroup_id[] = "get_table_vgroup_id"; + static const char __pyx_k_priv_datetime_epoch[] = "_priv_datetime_epoch"; + static const char __pyx_k_TaosConnection_close[] = "TaosConnection.close"; + static const char __pyx_k_TaosConnection_query[] = "TaosConnection.query"; + static const char __pyx_k_TaosResult_fetch_all[] = "TaosResult.fetch_all"; + static const char __pyx_k_TaosResult_rows_iter[] = "TaosResult.rows_iter"; + static const char __pyx_k_get_topic_assignment[] = "get_topic_assignment"; + static const char __pyx_k_TaosConnection_commit[] = "TaosConnection.commit"; + static const char __pyx_k_TaosConsumer_position[] = "TaosConsumer.position"; + static const char __pyx_k_select_database_error[] = "select database error"; + static const char __pyx_k_TaosConnection_execute[] = "TaosConnection.execute"; + static const char __pyx_k_TaosConnection_query_a[] = "TaosConnection.query_a"; + static const char __pyx_k_TaosConsumer_committed[] = "TaosConsumer.committed"; + static const char __pyx_k_TaosConsumer_subscribe[] = "TaosConsumer.subscribe"; + static const char __pyx_k_TaosResult_blocks_iter[] = "TaosResult.blocks_iter"; + static const char __pyx_k_TaosResult_fetch_block[] = "TaosResult.fetch_block"; + static const char __pyx_k_set_up_tmq_list_failed[] = "set up tmq list failed!"; + static const char __pyx_k_taos_fetch_raw_block_a[] = "taos_fetch_raw_block_a"; + static const char __pyx_k_Cursor_is_not_connected[] = "Cursor is not connected"; + static const char __pyx_k_Invalid_use_of_fetchall[] = "Invalid use of fetchall"; + static const char __pyx_k_TaosConnection_rollback[] = "TaosConnection.rollback"; + static const char __pyx_k_TaosResult__fetch_block[] = "TaosResult._fetch_block"; + static const char __pyx_k_TaosResult_fetch_rows_a[] = "TaosResult.fetch_rows_a"; + static const char __pyx_k_pyx_unpickle_TaosCursor[] = "__pyx_unpickle_TaosCursor"; + static const char __pyx_k_Invalid_use_of_rows_iter[] = "Invalid use of rows_iter"; + static const char __pyx_k_TaosConnection_select_db[] = "TaosConnection.select_db"; + static const char __pyx_k_TaosConnection_subscribe[] = "TaosConnection.subscribe"; + static const char __pyx_k_TaosConsumer_get_db_name[] = "TaosConsumer.get_db_name"; + static const char __pyx_k_TaosConsumer_offset_seek[] = "TaosConsumer.offset_seek"; + static const char __pyx_k_TaosConsumer_unsubscribe[] = "TaosConsumer.unsubscribe"; + static const char __pyx_k_TaosCursor__reset_result[] = "TaosCursor._reset_result"; + static const char __pyx_k_set_up_tmq_config_failed[] = "set up tmq config failed!"; + static const char __pyx_k_TaosConnection__init_conn[] = "TaosConnection._init_conn"; + static const char __pyx_k_TaosField___reduce_cython[] = "TaosField.__reduce_cython__"; + static const char __pyx_k_TaosConsumer_get_vgroup_id[] = "TaosConsumer.get_vgroup_id"; + static const char __pyx_k_TaosConsumer_offset_commit[] = "TaosConsumer.offset_commit"; + static const char __pyx_k_TaosConsumer_result_commit[] = "TaosConsumer.result_commit"; + static const char __pyx_k_TaosCursor___reduce_cython[] = "TaosCursor.__reduce_cython__"; + static const char __pyx_k_TaosResult___reduce_cython[] = "TaosResult.__reduce_cython__"; + static const char __pyx_k_TaosConsumer_get_topic_name[] = "TaosConsumer.get_topic_name"; + static const char __pyx_k_TaosField___setstate_cython[] = "TaosField.__setstate_cython__"; + static const char __pyx_k_TaosConnection__init_options[] = "TaosConnection._init_options"; + static const char __pyx_k_TaosConsumer___reduce_cython[] = "TaosConsumer.__reduce_cython__"; + static const char __pyx_k_TaosCursor___setstate_cython[] = "TaosCursor.__setstate_cython__"; + static const char __pyx_k_TaosResult___setstate_cython[] = "TaosResult.__setstate_cython__"; + static const char __pyx_k_Invalid_use_of_fetch_iterator[] = "Invalid use of fetch iterator"; + static const char __pyx_k_TaosConnection___reduce_cython[] = "TaosConnection.__reduce_cython__"; + static const char __pyx_k_TaosConnection_load_table_info[] = "TaosConnection.load_table_info"; + static const char __pyx_k_TaosConsumer___setstate_cython[] = "TaosConsumer.__setstate_cython__"; + static const char __pyx_k_TaosConsumer_get_vgroup_offset[] = "TaosConsumer.get_vgroup_offset"; + static const char __pyx_k_TaosResult__check_result_error[] = "TaosResult._check_result_error"; + static const char __pyx_k_TaosResult_fetch_all_into_dict[] = "TaosResult.fetch_all_into_dict"; + static const char __pyx_k_TaosConnection_clear_result_set[] = "TaosConnection.clear_result_set"; + static const char __pyx_k_TaosConnection_get_table_vgroup[] = "TaosConnection.get_table_vgroup_id"; + static const char __pyx_k_TaosResult_taos_fetch_raw_block[] = "TaosResult.taos_fetch_raw_block_a"; + static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))"; + static const char __pyx_k_TaosConnection___setstate_cython[] = "TaosConnection.__setstate_cython__"; + static const char __pyx_k_TaosConnection__check_conn_error[] = "TaosConnection._check_conn_error"; + static const char __pyx_k_TaosConsumer_get_topic_assignmen[] = "TaosConsumer.get_topic_assignment"; + static const char __pyx_k_TaosTopicAssignment___reduce_cyt[] = "TaosTopicAssignment.__reduce_cython__"; + static const char __pyx_k_TaosTopicAssignment___setstate_c[] = "TaosTopicAssignment.__setstate_cython__"; + static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +/* #### Code section: decls ### */ +static PyObject *__pyx_pf_4taos_8_objects_set_tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */ +static int __pyx_pf_4taos_8_objects_14TaosConnection___cinit__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_user, PyObject *__pyx_v_password, PyObject *__pyx_v_database, PyObject *__pyx_v_port, PyObject *__pyx_v_timezone, PyObject *__pyx_v_config); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_2_init_options(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_4_init_conn(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_6_check_conn_error(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static void __pyx_pf_4taos_8_objects_14TaosConnection_8__dealloc__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_10close(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_11client_info___get__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_11server_info___get__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_12select_db(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_database); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_14execute(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_req_id); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_16query(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_req_id); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_18query_a(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_callback, PyObject *__pyx_v_req_id); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_20subscribe(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_configs, CYTHON_UNUSED PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_22load_table_info(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_tables); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_24commit(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_26rollback(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_28clear_result_set(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_30get_table_vgroup_id(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_db, PyObject *__pyx_v_table); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_4taos_8_objects_9TaosField___cinit__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, PyObject *__pyx_v_name, int8_t __pyx_v_type_, int32_t __pyx_v_bytes); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4name___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4type___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_5bytes___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_6length___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_2__str__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4__repr__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_6__getitem__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_4taos_8_objects_10TaosResult___cinit__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, size_t __pyx_v_res); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_2__str__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_4__repr__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_6__iter__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_6fields___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_11field_count___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_9precision___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_13affected_rows___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_9row_count___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_8_check_result_error(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_10_fetch_block(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_12fetch_block(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_14fetch_all(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_16fetch_all_into_dict(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_18rows_iter(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_21blocks_iter(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_24fetch_rows_a(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static void __pyx_pf_4taos_8_objects_10TaosResult_28__dealloc__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_4taos_8_objects_10TaosCursor___init__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_connection); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_2__iter__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_11description___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_8rowcount___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_13affected_rows___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_5execute(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, PyObject *__pyx_v_sql, CYTHON_UNUSED PyObject *__pyx_v_params, PyObject *__pyx_v_req_id); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_7fetchone(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_9fetchall(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_11close(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_13_reset_result(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static void __pyx_pf_4taos_8_objects_10TaosCursor_15__del__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_17__reduce_cython__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_19__setstate_cython__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_4taos_8_objects_19TaosTopicAssignment___cinit__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self, int32_t __pyx_v_vg_id, int64_t __pyx_v_current_offset, int64_t __pyx_v_begin, int64_t __pyx_v_end); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_5vg_id___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_14current_offset___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_5begin___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_3end___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_4taos_8_objects_12TaosConsumer___cinit__(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_configs); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_2subscribe(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topics); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_4unsubscribe(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_6poll(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_8commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_10result_commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_12offset_commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id, PyObject *__pyx_v_offset); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_14get_topic_assignment(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_16offset_seek(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id, PyObject *__pyx_v_offset); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_18position(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_20committed(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_22get_topic_name(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_24get_db_name(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_26get_vgroup_id(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_28get_vgroup_offset(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ +static void __pyx_pf_4taos_8_objects_12TaosConsumer_30__dealloc__(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_4taos_8_objects_2__pyx_unpickle_TaosCursor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_4taos_8_objects_TaosConnection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4taos_8_objects_TaosField(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4taos_8_objects_TaosResult(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4taos_8_objects_TaosCursor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4taos_8_objects_TaosTopicAssignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4taos_8_objects_TaosConsumer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + PyObject *__pyx_type_4taos_8_objects_TaosConnection; + PyObject *__pyx_type_4taos_8_objects_TaosField; + PyObject *__pyx_type_4taos_8_objects_TaosResult; + PyObject *__pyx_type_4taos_8_objects_TaosCursor; + PyObject *__pyx_type_4taos_8_objects_TaosTopicAssignment; + PyObject *__pyx_type_4taos_8_objects_TaosConsumer; + PyObject *__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter; + PyObject *__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter; + PyObject *__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__; + #endif + PyTypeObject *__pyx_ptype_4taos_8_objects_TaosConnection; + PyTypeObject *__pyx_ptype_4taos_8_objects_TaosField; + PyTypeObject *__pyx_ptype_4taos_8_objects_TaosResult; + PyTypeObject *__pyx_ptype_4taos_8_objects_TaosCursor; + PyTypeObject *__pyx_ptype_4taos_8_objects_TaosTopicAssignment; + PyTypeObject *__pyx_ptype_4taos_8_objects_TaosConsumer; + PyTypeObject *__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter; + PyTypeObject *__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter; + PyTypeObject *__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__; + PyObject *__pyx_n_s_CONVERT_FUNC; + PyObject *__pyx_n_s_ConnectionError; + PyObject *__pyx_kp_u_Cursor_is_not_connected; + PyObject *__pyx_n_s_DatabaseError; + PyObject *__pyx_n_u_DictRow; + PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; + PyObject *__pyx_n_s_InternalError; + PyObject *__pyx_kp_u_Invalid_use_of_fetch_iterator; + PyObject *__pyx_kp_u_Invalid_use_of_fetchall; + PyObject *__pyx_kp_u_Invalid_use_of_rows_iter; + PyObject *__pyx_n_s_OSError; + PyObject *__pyx_n_s_OperationalError; + PyObject *__pyx_n_s_Optional; + PyObject *__pyx_kp_s_Optional_int; + PyObject *__pyx_n_s_PickleError; + PyObject *__pyx_n_s_ProgrammingError; + PyObject *__pyx_n_s_SIZED_TYPE; + PyObject *__pyx_n_s_StatementError; + PyObject *__pyx_n_s_TaosConnection; + PyObject *__pyx_n_s_TaosConnection___reduce_cython; + PyObject *__pyx_n_s_TaosConnection___setstate_cython; + PyObject *__pyx_n_s_TaosConnection__check_conn_error; + PyObject *__pyx_n_s_TaosConnection__init_conn; + PyObject *__pyx_n_s_TaosConnection__init_options; + PyObject *__pyx_n_s_TaosConnection_clear_result_set; + PyObject *__pyx_n_s_TaosConnection_close; + PyObject *__pyx_n_s_TaosConnection_commit; + PyObject *__pyx_n_s_TaosConnection_execute; + PyObject *__pyx_n_s_TaosConnection_get_table_vgroup; + PyObject *__pyx_n_s_TaosConnection_load_table_info; + PyObject *__pyx_n_s_TaosConnection_query; + PyObject *__pyx_n_s_TaosConnection_query_a; + PyObject *__pyx_n_s_TaosConnection_rollback; + PyObject *__pyx_n_s_TaosConnection_select_db; + PyObject *__pyx_n_s_TaosConnection_subscribe; + PyObject *__pyx_n_s_TaosConsumer; + PyObject *__pyx_n_s_TaosConsumer___reduce_cython; + PyObject *__pyx_n_s_TaosConsumer___setstate_cython; + PyObject *__pyx_n_s_TaosConsumer_commit; + PyObject *__pyx_n_s_TaosConsumer_committed; + PyObject *__pyx_n_s_TaosConsumer_get_db_name; + PyObject *__pyx_n_s_TaosConsumer_get_topic_assignmen; + PyObject *__pyx_n_s_TaosConsumer_get_topic_name; + PyObject *__pyx_n_s_TaosConsumer_get_vgroup_id; + PyObject *__pyx_n_s_TaosConsumer_get_vgroup_offset; + PyObject *__pyx_n_s_TaosConsumer_offset_commit; + PyObject *__pyx_n_s_TaosConsumer_offset_seek; + PyObject *__pyx_n_s_TaosConsumer_poll; + PyObject *__pyx_n_s_TaosConsumer_position; + PyObject *__pyx_n_s_TaosConsumer_result_commit; + PyObject *__pyx_n_s_TaosConsumer_subscribe; + PyObject *__pyx_n_s_TaosConsumer_unsubscribe; + PyObject *__pyx_n_s_TaosCursor; + PyObject *__pyx_n_s_TaosCursor___iter; + PyObject *__pyx_n_s_TaosCursor___reduce_cython; + PyObject *__pyx_n_s_TaosCursor___setstate_cython; + PyObject *__pyx_n_s_TaosCursor__reset_result; + PyObject *__pyx_n_s_TaosCursor_close; + PyObject *__pyx_n_s_TaosCursor_execute; + PyObject *__pyx_n_s_TaosCursor_fetchall; + PyObject *__pyx_n_s_TaosCursor_fetchone; + PyObject *__pyx_n_s_TaosField; + PyObject *__pyx_n_s_TaosField___reduce_cython; + PyObject *__pyx_n_s_TaosField___setstate_cython; + PyObject *__pyx_kp_u_TaosField_name; + PyObject *__pyx_n_s_TaosResult; + PyObject *__pyx_n_s_TaosResult___reduce_cython; + PyObject *__pyx_n_s_TaosResult___setstate_cython; + PyObject *__pyx_n_s_TaosResult__check_result_error; + PyObject *__pyx_n_s_TaosResult__fetch_block; + PyObject *__pyx_n_s_TaosResult_blocks_iter; + PyObject *__pyx_n_s_TaosResult_fetch_all; + PyObject *__pyx_n_s_TaosResult_fetch_all_into_dict; + PyObject *__pyx_n_s_TaosResult_fetch_block; + PyObject *__pyx_n_s_TaosResult_fetch_rows_a; + PyObject *__pyx_kp_u_TaosResult_res; + PyObject *__pyx_n_s_TaosResult_rows_iter; + PyObject *__pyx_n_s_TaosResult_taos_fetch_raw_block; + PyObject *__pyx_n_s_TaosTopicAssignment; + PyObject *__pyx_n_s_TaosTopicAssignment___reduce_cyt; + PyObject *__pyx_n_s_TaosTopicAssignment___setstate_c; + PyObject *__pyx_n_s_TmqError; + PyObject *__pyx_n_s_TypeError; + PyObject *__pyx_n_s_UNSIZED_TYPE; + PyObject *__pyx_n_u_UTC; + PyObject *__pyx_n_s__101; + PyObject *__pyx_kp_u__12; + PyObject *__pyx_kp_u__19; + PyObject *__pyx_kp_u__63; + PyObject *__pyx_n_s__64; + PyObject *__pyx_n_s_affected_rows; + PyObject *__pyx_n_s_args; + PyObject *__pyx_n_s_asdict; + PyObject *__pyx_n_s_assignment; + PyObject *__pyx_n_s_assignment_ptr; + PyObject *__pyx_n_s_astimezone; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_n_s_b; + PyObject *__pyx_n_s_begin; + PyObject *__pyx_n_s_block; + PyObject *__pyx_n_s_blocks; + PyObject *__pyx_n_s_blocks_iter; + PyObject *__pyx_n_s_bytes; + PyObject *__pyx_kp_u_bytes_2; + PyObject *__pyx_kp_u_callback; + PyObject *__pyx_n_s_callback_2; + PyObject *__pyx_n_s_check_conn_error; + PyObject *__pyx_n_s_check_result_error; + PyObject *__pyx_n_s_clear_result_set; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_close; + PyObject *__pyx_n_s_code; + PyObject *__pyx_n_s_collections; + PyObject *__pyx_n_s_commit; + PyObject *__pyx_n_s_committed; + PyObject *__pyx_n_s_config; + PyObject *__pyx_n_s_configs; + PyObject *__pyx_n_s_connection; + PyObject *__pyx_n_s_current_offset; + PyObject *__pyx_n_u_d; + PyObject *__pyx_n_s_data; + PyObject *__pyx_n_s_database; + PyObject *__pyx_n_s_database_2; + PyObject *__pyx_n_s_datetime; + PyObject *__pyx_n_s_datetime_epoch; + PyObject *__pyx_n_s_db; + PyObject *__pyx_n_s_db_2; + PyObject *__pyx_n_s_decode; + PyObject *__pyx_n_s_dict; + PyObject *__pyx_n_s_dict_2; + PyObject *__pyx_n_s_dict_row_cls; + PyObject *__pyx_kp_s_dict_str_str; + PyObject *__pyx_kp_u_disable; + PyObject *__pyx_n_s_dt; + PyObject *__pyx_n_s_dt_epoch; + PyObject *__pyx_kp_u_enable; + PyObject *__pyx_n_s_encode; + PyObject *__pyx_n_s_end; + PyObject *__pyx_n_s_errno; + PyObject *__pyx_n_s_errstr; + PyObject *__pyx_n_s_execute; + PyObject *__pyx_n_s_f; + PyObject *__pyx_n_s_fetch_all; + PyObject *__pyx_n_s_fetch_all_into_dict; + PyObject *__pyx_n_s_fetch_block; + PyObject *__pyx_n_s_fetch_block_2; + PyObject *__pyx_n_s_fetch_rows_a; + PyObject *__pyx_n_s_fetchall; + PyObject *__pyx_n_s_fetchone; + PyObject *__pyx_n_s_field; + PyObject *__pyx_n_s_field_names; + PyObject *__pyx_n_s_fields; + PyObject *__pyx_n_s_fromtimestamp; + PyObject *__pyx_kp_u_gc; + PyObject *__pyx_n_s_get_db_name; + PyObject *__pyx_n_s_get_table_vgroup_id; + PyObject *__pyx_n_s_get_topic_assignment; + PyObject *__pyx_n_s_get_topic_name; + PyObject *__pyx_n_s_get_vgroup_id; + PyObject *__pyx_n_s_get_vgroup_offset; + PyObject *__pyx_n_s_getstate; + PyObject *__pyx_n_s_host; + PyObject *__pyx_n_s_i; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_init_conn; + PyObject *__pyx_n_s_init_options; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_n_s_int; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_n_s_is_null; + PyObject *__pyx_kp_u_isenabled; + PyObject *__pyx_n_s_items; + PyObject *__pyx_n_s_iter; + PyObject *__pyx_n_s_k; + PyObject *__pyx_n_s_k_2; + PyObject *__pyx_n_s_list; + PyObject *__pyx_kp_s_list_str; + PyObject *__pyx_n_s_load_table_info; + PyObject *__pyx_n_s_localize; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_map; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_name_2; + PyObject *__pyx_n_s_namedtuple; + PyObject *__pyx_n_s_new; + PyObject *__pyx_kp_s_no_default___reduce___due_to_non; + PyObject *__pyx_n_s_num_of_assignment; + PyObject *__pyx_n_s_num_of_rows; + PyObject *__pyx_n_s_offset; + PyObject *__pyx_n_s_offset_commit; + PyObject *__pyx_n_s_offset_seek; + PyObject *__pyx_n_s_offsets; + PyObject *__pyx_n_s_params; + PyObject *__pyx_n_s_password; + PyObject *__pyx_n_s_pblock; + PyObject *__pyx_n_s_pickle; + PyObject *__pyx_n_s_poll; + PyObject *__pyx_n_s_port; + PyObject *__pyx_n_s_pos; + PyObject *__pyx_n_s_position; + PyObject *__pyx_n_s_print; + PyObject *__pyx_n_s_priv_datetime_epoch; + PyObject *__pyx_n_s_priv_tz; + PyObject *__pyx_n_s_pytz; + PyObject *__pyx_n_s_pyx_PickleError; + PyObject *__pyx_n_s_pyx_checksum; + PyObject *__pyx_n_s_pyx_result; + PyObject *__pyx_n_s_pyx_state; + PyObject *__pyx_n_s_pyx_type; + PyObject *__pyx_n_s_pyx_unpickle_TaosCursor; + PyObject *__pyx_n_s_query; + PyObject *__pyx_n_s_query_a; + PyObject *__pyx_n_s_r; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_reduce; + PyObject *__pyx_n_s_reduce_cython; + PyObject *__pyx_n_s_reduce_ex; + PyObject *__pyx_n_s_req_id; + PyObject *__pyx_n_s_res; + PyObject *__pyx_n_s_reset_result; + PyObject *__pyx_n_s_result_commit; + PyObject *__pyx_n_s_rollback; + PyObject *__pyx_n_u_root; + PyObject *__pyx_n_s_row; + PyObject *__pyx_n_s_row_count; + PyObject *__pyx_n_s_rows_iter; + PyObject *__pyx_n_s_seconds; + PyObject *__pyx_kp_u_select_database_error; + PyObject *__pyx_n_s_select_db; + PyObject *__pyx_n_s_self; + PyObject *__pyx_n_s_send; + PyObject *__pyx_n_s_set_tz; + PyObject *__pyx_kp_u_set_up_tmq_config_failed; + PyObject *__pyx_kp_u_set_up_tmq_list_failed; + PyObject *__pyx_n_s_setstate; + PyObject *__pyx_n_s_setstate_cython; + PyObject *__pyx_kp_u_setup_tmq_failed; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_n_s_sql; + PyObject *__pyx_n_s_sql_2; + PyObject *__pyx_n_s_state; + PyObject *__pyx_n_s_str; + PyObject *__pyx_kp_s_stringsource; + PyObject *__pyx_n_s_subscribe; + PyObject *__pyx_n_s_table; + PyObject *__pyx_n_s_table_2; + PyObject *__pyx_n_s_tables; + PyObject *__pyx_n_s_tables_2; + PyObject *__pyx_n_s_taos__cinterface; + PyObject *__pyx_n_s_taos__objects; + PyObject *__pyx_kp_s_taos__objects_pyx; + PyObject *__pyx_n_s_taos_error; + PyObject *__pyx_n_s_taos_fetch_raw_block_a; + PyObject *__pyx_n_s_taos_res; + PyObject *__pyx_n_s_taos_row; + PyObject *__pyx_n_u_taosdata; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_throw; + PyObject *__pyx_n_s_timedelta; + PyObject *__pyx_n_s_timeout; + PyObject *__pyx_n_s_timezone; + PyObject *__pyx_n_s_tmq_conf; + PyObject *__pyx_kp_u_tmq_conf_res; + PyObject *__pyx_n_s_tmq_conf_res_2; + PyObject *__pyx_n_s_tmq_errno; + PyObject *__pyx_n_s_tmq_list; + PyObject *__pyx_n_s_topic; + PyObject *__pyx_n_s_topic_2; + PyObject *__pyx_n_s_topic_assignments; + PyObject *__pyx_n_s_topics; + PyObject *__pyx_n_s_tp; + PyObject *__pyx_n_s_tp_2; + PyObject *__pyx_n_s_tta; + PyObject *__pyx_n_s_type; + PyObject *__pyx_kp_u_type_2; + PyObject *__pyx_n_s_type_3; + PyObject *__pyx_n_s_typing; + PyObject *__pyx_n_s_tz; + PyObject *__pyx_n_s_unsubscribe; + PyObject *__pyx_n_s_update; + PyObject *__pyx_n_s_use_setstate; + PyObject *__pyx_n_s_user; + PyObject *__pyx_n_s_utc_datetime_epoch; + PyObject *__pyx_n_s_utc_tz; + PyObject *__pyx_n_s_utcfromtimestamp; + PyObject *__pyx_kp_u_utf_8; + PyObject *__pyx_n_s_v; + PyObject *__pyx_n_s_v_2; + PyObject *__pyx_n_s_vg_id; + PyObject *__pyx_n_s_zip; + PyObject *__pyx_int_0; + PyObject *__pyx_int_1; + PyObject *__pyx_int_86400; + PyObject *__pyx_int_17084266; + PyObject *__pyx_int_126557407; + PyObject *__pyx_int_199624353; + PyObject *__pyx_codeobj_; + PyObject *__pyx_tuple__42; + PyObject *__pyx_tuple__43; + PyObject *__pyx_tuple__45; + PyObject *__pyx_tuple__62; + PyObject *__pyx_tuple__65; + PyObject *__pyx_tuple__66; + PyObject *__pyx_tuple__67; + PyObject *__pyx_tuple__68; + PyObject *__pyx_tuple__69; + PyObject *__pyx_tuple__70; + PyObject *__pyx_tuple__71; + PyObject *__pyx_tuple__72; + PyObject *__pyx_tuple__73; + PyObject *__pyx_tuple__74; + PyObject *__pyx_tuple__75; + PyObject *__pyx_tuple__76; + PyObject *__pyx_tuple__77; + PyObject *__pyx_tuple__78; + PyObject *__pyx_tuple__79; + PyObject *__pyx_tuple__80; + PyObject *__pyx_tuple__81; + PyObject *__pyx_tuple__82; + PyObject *__pyx_tuple__83; + PyObject *__pyx_tuple__84; + PyObject *__pyx_tuple__85; + PyObject *__pyx_tuple__86; + PyObject *__pyx_tuple__87; + PyObject *__pyx_tuple__88; + PyObject *__pyx_tuple__89; + PyObject *__pyx_tuple__90; + PyObject *__pyx_tuple__91; + PyObject *__pyx_tuple__92; + PyObject *__pyx_tuple__93; + PyObject *__pyx_tuple__94; + PyObject *__pyx_tuple__95; + PyObject *__pyx_tuple__96; + PyObject *__pyx_tuple__97; + PyObject *__pyx_tuple__98; + PyObject *__pyx_tuple__99; + PyObject *__pyx_codeobj__2; + PyObject *__pyx_codeobj__3; + PyObject *__pyx_codeobj__4; + PyObject *__pyx_codeobj__5; + PyObject *__pyx_codeobj__6; + PyObject *__pyx_codeobj__7; + PyObject *__pyx_codeobj__8; + PyObject *__pyx_codeobj__9; + PyObject *__pyx_tuple__100; + PyObject *__pyx_codeobj__10; + PyObject *__pyx_codeobj__11; + PyObject *__pyx_codeobj__13; + PyObject *__pyx_codeobj__14; + PyObject *__pyx_codeobj__15; + PyObject *__pyx_codeobj__16; + PyObject *__pyx_codeobj__17; + PyObject *__pyx_codeobj__18; + PyObject *__pyx_codeobj__20; + PyObject *__pyx_codeobj__21; + PyObject *__pyx_codeobj__22; + PyObject *__pyx_codeobj__23; + PyObject *__pyx_codeobj__24; + PyObject *__pyx_codeobj__25; + PyObject *__pyx_codeobj__26; + PyObject *__pyx_codeobj__27; + PyObject *__pyx_codeobj__28; + PyObject *__pyx_codeobj__29; + PyObject *__pyx_codeobj__30; + PyObject *__pyx_codeobj__31; + PyObject *__pyx_codeobj__32; + PyObject *__pyx_codeobj__33; + PyObject *__pyx_codeobj__34; + PyObject *__pyx_codeobj__35; + PyObject *__pyx_codeobj__36; + PyObject *__pyx_codeobj__37; + PyObject *__pyx_codeobj__38; + PyObject *__pyx_codeobj__39; + PyObject *__pyx_codeobj__40; + PyObject *__pyx_codeobj__41; + PyObject *__pyx_codeobj__44; + PyObject *__pyx_codeobj__46; + PyObject *__pyx_codeobj__47; + PyObject *__pyx_codeobj__48; + PyObject *__pyx_codeobj__49; + PyObject *__pyx_codeobj__50; + PyObject *__pyx_codeobj__51; + PyObject *__pyx_codeobj__52; + PyObject *__pyx_codeobj__53; + PyObject *__pyx_codeobj__54; + PyObject *__pyx_codeobj__55; + PyObject *__pyx_codeobj__56; + PyObject *__pyx_codeobj__57; + PyObject *__pyx_codeobj__58; + PyObject *__pyx_codeobj__59; + PyObject *__pyx_codeobj__60; + PyObject *__pyx_codeobj__61; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosConnection); + Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosConnection); + Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosField); + Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosField); + Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosResult); + Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosResult); + Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosCursor); + Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosCursor); + Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosTopicAssignment); + Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosTopicAssignment); + Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosConsumer); + Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosConsumer); + Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter); + Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter); + Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter); + Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter); + Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__); + Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__); + Py_CLEAR(clear_module_state->__pyx_n_s_CONVERT_FUNC); + Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionError); + Py_CLEAR(clear_module_state->__pyx_kp_u_Cursor_is_not_connected); + Py_CLEAR(clear_module_state->__pyx_n_s_DatabaseError); + Py_CLEAR(clear_module_state->__pyx_n_u_DictRow); + Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); + Py_CLEAR(clear_module_state->__pyx_n_s_InternalError); + Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_use_of_fetch_iterator); + Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_use_of_fetchall); + Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_use_of_rows_iter); + Py_CLEAR(clear_module_state->__pyx_n_s_OSError); + Py_CLEAR(clear_module_state->__pyx_n_s_OperationalError); + Py_CLEAR(clear_module_state->__pyx_n_s_Optional); + Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_int); + Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); + Py_CLEAR(clear_module_state->__pyx_n_s_ProgrammingError); + Py_CLEAR(clear_module_state->__pyx_n_s_SIZED_TYPE); + Py_CLEAR(clear_module_state->__pyx_n_s_StatementError); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection___reduce_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection___setstate_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection__check_conn_error); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection__init_conn); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection__init_options); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_clear_result_set); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_close); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_commit); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_execute); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_get_table_vgroup); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_load_table_info); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_query); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_query_a); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_rollback); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_select_db); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_subscribe); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer___reduce_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer___setstate_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_commit); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_committed); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_db_name); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_topic_assignmen); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_topic_name); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_vgroup_id); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_vgroup_offset); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_offset_commit); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_offset_seek); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_poll); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_position); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_result_commit); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_subscribe); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_unsubscribe); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor___iter); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor___reduce_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor___setstate_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor__reset_result); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor_close); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor_execute); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor_fetchall); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor_fetchone); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosField); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosField___reduce_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosField___setstate_cython); + Py_CLEAR(clear_module_state->__pyx_kp_u_TaosField_name); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult___reduce_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult___setstate_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult__check_result_error); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult__fetch_block); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_blocks_iter); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_fetch_all); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_fetch_all_into_dict); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_fetch_block); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_fetch_rows_a); + Py_CLEAR(clear_module_state->__pyx_kp_u_TaosResult_res); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_rows_iter); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_taos_fetch_raw_block); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosTopicAssignment); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosTopicAssignment___reduce_cyt); + Py_CLEAR(clear_module_state->__pyx_n_s_TaosTopicAssignment___setstate_c); + Py_CLEAR(clear_module_state->__pyx_n_s_TmqError); + Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); + Py_CLEAR(clear_module_state->__pyx_n_s_UNSIZED_TYPE); + Py_CLEAR(clear_module_state->__pyx_n_u_UTC); + Py_CLEAR(clear_module_state->__pyx_n_s__101); + Py_CLEAR(clear_module_state->__pyx_kp_u__12); + Py_CLEAR(clear_module_state->__pyx_kp_u__19); + Py_CLEAR(clear_module_state->__pyx_kp_u__63); + Py_CLEAR(clear_module_state->__pyx_n_s__64); + Py_CLEAR(clear_module_state->__pyx_n_s_affected_rows); + Py_CLEAR(clear_module_state->__pyx_n_s_args); + Py_CLEAR(clear_module_state->__pyx_n_s_asdict); + Py_CLEAR(clear_module_state->__pyx_n_s_assignment); + Py_CLEAR(clear_module_state->__pyx_n_s_assignment_ptr); + Py_CLEAR(clear_module_state->__pyx_n_s_astimezone); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_n_s_b); + Py_CLEAR(clear_module_state->__pyx_n_s_begin); + Py_CLEAR(clear_module_state->__pyx_n_s_block); + Py_CLEAR(clear_module_state->__pyx_n_s_blocks); + Py_CLEAR(clear_module_state->__pyx_n_s_blocks_iter); + Py_CLEAR(clear_module_state->__pyx_n_s_bytes); + Py_CLEAR(clear_module_state->__pyx_kp_u_bytes_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_callback); + Py_CLEAR(clear_module_state->__pyx_n_s_callback_2); + Py_CLEAR(clear_module_state->__pyx_n_s_check_conn_error); + Py_CLEAR(clear_module_state->__pyx_n_s_check_result_error); + Py_CLEAR(clear_module_state->__pyx_n_s_clear_result_set); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_close); + Py_CLEAR(clear_module_state->__pyx_n_s_code); + Py_CLEAR(clear_module_state->__pyx_n_s_collections); + Py_CLEAR(clear_module_state->__pyx_n_s_commit); + Py_CLEAR(clear_module_state->__pyx_n_s_committed); + Py_CLEAR(clear_module_state->__pyx_n_s_config); + Py_CLEAR(clear_module_state->__pyx_n_s_configs); + Py_CLEAR(clear_module_state->__pyx_n_s_connection); + Py_CLEAR(clear_module_state->__pyx_n_s_current_offset); + Py_CLEAR(clear_module_state->__pyx_n_u_d); + Py_CLEAR(clear_module_state->__pyx_n_s_data); + Py_CLEAR(clear_module_state->__pyx_n_s_database); + Py_CLEAR(clear_module_state->__pyx_n_s_database_2); + Py_CLEAR(clear_module_state->__pyx_n_s_datetime); + Py_CLEAR(clear_module_state->__pyx_n_s_datetime_epoch); + Py_CLEAR(clear_module_state->__pyx_n_s_db); + Py_CLEAR(clear_module_state->__pyx_n_s_db_2); + Py_CLEAR(clear_module_state->__pyx_n_s_decode); + Py_CLEAR(clear_module_state->__pyx_n_s_dict); + Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); + Py_CLEAR(clear_module_state->__pyx_n_s_dict_row_cls); + Py_CLEAR(clear_module_state->__pyx_kp_s_dict_str_str); + Py_CLEAR(clear_module_state->__pyx_kp_u_disable); + Py_CLEAR(clear_module_state->__pyx_n_s_dt); + Py_CLEAR(clear_module_state->__pyx_n_s_dt_epoch); + Py_CLEAR(clear_module_state->__pyx_kp_u_enable); + Py_CLEAR(clear_module_state->__pyx_n_s_encode); + Py_CLEAR(clear_module_state->__pyx_n_s_end); + Py_CLEAR(clear_module_state->__pyx_n_s_errno); + Py_CLEAR(clear_module_state->__pyx_n_s_errstr); + Py_CLEAR(clear_module_state->__pyx_n_s_execute); + Py_CLEAR(clear_module_state->__pyx_n_s_f); + Py_CLEAR(clear_module_state->__pyx_n_s_fetch_all); + Py_CLEAR(clear_module_state->__pyx_n_s_fetch_all_into_dict); + Py_CLEAR(clear_module_state->__pyx_n_s_fetch_block); + Py_CLEAR(clear_module_state->__pyx_n_s_fetch_block_2); + Py_CLEAR(clear_module_state->__pyx_n_s_fetch_rows_a); + Py_CLEAR(clear_module_state->__pyx_n_s_fetchall); + Py_CLEAR(clear_module_state->__pyx_n_s_fetchone); + Py_CLEAR(clear_module_state->__pyx_n_s_field); + Py_CLEAR(clear_module_state->__pyx_n_s_field_names); + Py_CLEAR(clear_module_state->__pyx_n_s_fields); + Py_CLEAR(clear_module_state->__pyx_n_s_fromtimestamp); + Py_CLEAR(clear_module_state->__pyx_kp_u_gc); + Py_CLEAR(clear_module_state->__pyx_n_s_get_db_name); + Py_CLEAR(clear_module_state->__pyx_n_s_get_table_vgroup_id); + Py_CLEAR(clear_module_state->__pyx_n_s_get_topic_assignment); + Py_CLEAR(clear_module_state->__pyx_n_s_get_topic_name); + Py_CLEAR(clear_module_state->__pyx_n_s_get_vgroup_id); + Py_CLEAR(clear_module_state->__pyx_n_s_get_vgroup_offset); + Py_CLEAR(clear_module_state->__pyx_n_s_getstate); + Py_CLEAR(clear_module_state->__pyx_n_s_host); + Py_CLEAR(clear_module_state->__pyx_n_s_i); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_init_conn); + Py_CLEAR(clear_module_state->__pyx_n_s_init_options); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_n_s_int); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_n_s_is_null); + Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); + Py_CLEAR(clear_module_state->__pyx_n_s_items); + Py_CLEAR(clear_module_state->__pyx_n_s_iter); + Py_CLEAR(clear_module_state->__pyx_n_s_k); + Py_CLEAR(clear_module_state->__pyx_n_s_k_2); + Py_CLEAR(clear_module_state->__pyx_n_s_list); + Py_CLEAR(clear_module_state->__pyx_kp_s_list_str); + Py_CLEAR(clear_module_state->__pyx_n_s_load_table_info); + Py_CLEAR(clear_module_state->__pyx_n_s_localize); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_map); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_name_2); + Py_CLEAR(clear_module_state->__pyx_n_s_namedtuple); + Py_CLEAR(clear_module_state->__pyx_n_s_new); + Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); + Py_CLEAR(clear_module_state->__pyx_n_s_num_of_assignment); + Py_CLEAR(clear_module_state->__pyx_n_s_num_of_rows); + Py_CLEAR(clear_module_state->__pyx_n_s_offset); + Py_CLEAR(clear_module_state->__pyx_n_s_offset_commit); + Py_CLEAR(clear_module_state->__pyx_n_s_offset_seek); + Py_CLEAR(clear_module_state->__pyx_n_s_offsets); + Py_CLEAR(clear_module_state->__pyx_n_s_params); + Py_CLEAR(clear_module_state->__pyx_n_s_password); + Py_CLEAR(clear_module_state->__pyx_n_s_pblock); + Py_CLEAR(clear_module_state->__pyx_n_s_pickle); + Py_CLEAR(clear_module_state->__pyx_n_s_poll); + Py_CLEAR(clear_module_state->__pyx_n_s_port); + Py_CLEAR(clear_module_state->__pyx_n_s_pos); + Py_CLEAR(clear_module_state->__pyx_n_s_position); + Py_CLEAR(clear_module_state->__pyx_n_s_print); + Py_CLEAR(clear_module_state->__pyx_n_s_priv_datetime_epoch); + Py_CLEAR(clear_module_state->__pyx_n_s_priv_tz); + Py_CLEAR(clear_module_state->__pyx_n_s_pytz); + Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); + Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); + Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); + Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); + Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); + Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_TaosCursor); + Py_CLEAR(clear_module_state->__pyx_n_s_query); + Py_CLEAR(clear_module_state->__pyx_n_s_query_a); + Py_CLEAR(clear_module_state->__pyx_n_s_r); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_reduce); + Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); + Py_CLEAR(clear_module_state->__pyx_n_s_req_id); + Py_CLEAR(clear_module_state->__pyx_n_s_res); + Py_CLEAR(clear_module_state->__pyx_n_s_reset_result); + Py_CLEAR(clear_module_state->__pyx_n_s_result_commit); + Py_CLEAR(clear_module_state->__pyx_n_s_rollback); + Py_CLEAR(clear_module_state->__pyx_n_u_root); + Py_CLEAR(clear_module_state->__pyx_n_s_row); + Py_CLEAR(clear_module_state->__pyx_n_s_row_count); + Py_CLEAR(clear_module_state->__pyx_n_s_rows_iter); + Py_CLEAR(clear_module_state->__pyx_n_s_seconds); + Py_CLEAR(clear_module_state->__pyx_kp_u_select_database_error); + Py_CLEAR(clear_module_state->__pyx_n_s_select_db); + Py_CLEAR(clear_module_state->__pyx_n_s_self); + Py_CLEAR(clear_module_state->__pyx_n_s_send); + Py_CLEAR(clear_module_state->__pyx_n_s_set_tz); + Py_CLEAR(clear_module_state->__pyx_kp_u_set_up_tmq_config_failed); + Py_CLEAR(clear_module_state->__pyx_kp_u_set_up_tmq_list_failed); + Py_CLEAR(clear_module_state->__pyx_n_s_setstate); + Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); + Py_CLEAR(clear_module_state->__pyx_kp_u_setup_tmq_failed); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_n_s_sql); + Py_CLEAR(clear_module_state->__pyx_n_s_sql_2); + Py_CLEAR(clear_module_state->__pyx_n_s_state); + Py_CLEAR(clear_module_state->__pyx_n_s_str); + Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); + Py_CLEAR(clear_module_state->__pyx_n_s_subscribe); + Py_CLEAR(clear_module_state->__pyx_n_s_table); + Py_CLEAR(clear_module_state->__pyx_n_s_table_2); + Py_CLEAR(clear_module_state->__pyx_n_s_tables); + Py_CLEAR(clear_module_state->__pyx_n_s_tables_2); + Py_CLEAR(clear_module_state->__pyx_n_s_taos__cinterface); + Py_CLEAR(clear_module_state->__pyx_n_s_taos__objects); + Py_CLEAR(clear_module_state->__pyx_kp_s_taos__objects_pyx); + Py_CLEAR(clear_module_state->__pyx_n_s_taos_error); + Py_CLEAR(clear_module_state->__pyx_n_s_taos_fetch_raw_block_a); + Py_CLEAR(clear_module_state->__pyx_n_s_taos_res); + Py_CLEAR(clear_module_state->__pyx_n_s_taos_row); + Py_CLEAR(clear_module_state->__pyx_n_u_taosdata); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_throw); + Py_CLEAR(clear_module_state->__pyx_n_s_timedelta); + Py_CLEAR(clear_module_state->__pyx_n_s_timeout); + Py_CLEAR(clear_module_state->__pyx_n_s_timezone); + Py_CLEAR(clear_module_state->__pyx_n_s_tmq_conf); + Py_CLEAR(clear_module_state->__pyx_kp_u_tmq_conf_res); + Py_CLEAR(clear_module_state->__pyx_n_s_tmq_conf_res_2); + Py_CLEAR(clear_module_state->__pyx_n_s_tmq_errno); + Py_CLEAR(clear_module_state->__pyx_n_s_tmq_list); + Py_CLEAR(clear_module_state->__pyx_n_s_topic); + Py_CLEAR(clear_module_state->__pyx_n_s_topic_2); + Py_CLEAR(clear_module_state->__pyx_n_s_topic_assignments); + Py_CLEAR(clear_module_state->__pyx_n_s_topics); + Py_CLEAR(clear_module_state->__pyx_n_s_tp); + Py_CLEAR(clear_module_state->__pyx_n_s_tp_2); + Py_CLEAR(clear_module_state->__pyx_n_s_tta); + Py_CLEAR(clear_module_state->__pyx_n_s_type); + Py_CLEAR(clear_module_state->__pyx_kp_u_type_2); + Py_CLEAR(clear_module_state->__pyx_n_s_type_3); + Py_CLEAR(clear_module_state->__pyx_n_s_typing); + Py_CLEAR(clear_module_state->__pyx_n_s_tz); + Py_CLEAR(clear_module_state->__pyx_n_s_unsubscribe); + Py_CLEAR(clear_module_state->__pyx_n_s_update); + Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); + Py_CLEAR(clear_module_state->__pyx_n_s_user); + Py_CLEAR(clear_module_state->__pyx_n_s_utc_datetime_epoch); + Py_CLEAR(clear_module_state->__pyx_n_s_utc_tz); + Py_CLEAR(clear_module_state->__pyx_n_s_utcfromtimestamp); + Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); + Py_CLEAR(clear_module_state->__pyx_n_s_v); + Py_CLEAR(clear_module_state->__pyx_n_s_v_2); + Py_CLEAR(clear_module_state->__pyx_n_s_vg_id); + Py_CLEAR(clear_module_state->__pyx_n_s_zip); + Py_CLEAR(clear_module_state->__pyx_int_0); + Py_CLEAR(clear_module_state->__pyx_int_1); + Py_CLEAR(clear_module_state->__pyx_int_86400); + Py_CLEAR(clear_module_state->__pyx_int_17084266); + Py_CLEAR(clear_module_state->__pyx_int_126557407); + Py_CLEAR(clear_module_state->__pyx_int_199624353); + Py_CLEAR(clear_module_state->__pyx_codeobj_); + Py_CLEAR(clear_module_state->__pyx_tuple__42); + Py_CLEAR(clear_module_state->__pyx_tuple__43); + Py_CLEAR(clear_module_state->__pyx_tuple__45); + Py_CLEAR(clear_module_state->__pyx_tuple__62); + Py_CLEAR(clear_module_state->__pyx_tuple__65); + Py_CLEAR(clear_module_state->__pyx_tuple__66); + Py_CLEAR(clear_module_state->__pyx_tuple__67); + Py_CLEAR(clear_module_state->__pyx_tuple__68); + Py_CLEAR(clear_module_state->__pyx_tuple__69); + Py_CLEAR(clear_module_state->__pyx_tuple__70); + Py_CLEAR(clear_module_state->__pyx_tuple__71); + Py_CLEAR(clear_module_state->__pyx_tuple__72); + Py_CLEAR(clear_module_state->__pyx_tuple__73); + Py_CLEAR(clear_module_state->__pyx_tuple__74); + Py_CLEAR(clear_module_state->__pyx_tuple__75); + Py_CLEAR(clear_module_state->__pyx_tuple__76); + Py_CLEAR(clear_module_state->__pyx_tuple__77); + Py_CLEAR(clear_module_state->__pyx_tuple__78); + Py_CLEAR(clear_module_state->__pyx_tuple__79); + Py_CLEAR(clear_module_state->__pyx_tuple__80); + Py_CLEAR(clear_module_state->__pyx_tuple__81); + Py_CLEAR(clear_module_state->__pyx_tuple__82); + Py_CLEAR(clear_module_state->__pyx_tuple__83); + Py_CLEAR(clear_module_state->__pyx_tuple__84); + Py_CLEAR(clear_module_state->__pyx_tuple__85); + Py_CLEAR(clear_module_state->__pyx_tuple__86); + Py_CLEAR(clear_module_state->__pyx_tuple__87); + Py_CLEAR(clear_module_state->__pyx_tuple__88); + Py_CLEAR(clear_module_state->__pyx_tuple__89); + Py_CLEAR(clear_module_state->__pyx_tuple__90); + Py_CLEAR(clear_module_state->__pyx_tuple__91); + Py_CLEAR(clear_module_state->__pyx_tuple__92); + Py_CLEAR(clear_module_state->__pyx_tuple__93); + Py_CLEAR(clear_module_state->__pyx_tuple__94); + Py_CLEAR(clear_module_state->__pyx_tuple__95); + Py_CLEAR(clear_module_state->__pyx_tuple__96); + Py_CLEAR(clear_module_state->__pyx_tuple__97); + Py_CLEAR(clear_module_state->__pyx_tuple__98); + Py_CLEAR(clear_module_state->__pyx_tuple__99); + Py_CLEAR(clear_module_state->__pyx_codeobj__2); + Py_CLEAR(clear_module_state->__pyx_codeobj__3); + Py_CLEAR(clear_module_state->__pyx_codeobj__4); + Py_CLEAR(clear_module_state->__pyx_codeobj__5); + Py_CLEAR(clear_module_state->__pyx_codeobj__6); + Py_CLEAR(clear_module_state->__pyx_codeobj__7); + Py_CLEAR(clear_module_state->__pyx_codeobj__8); + Py_CLEAR(clear_module_state->__pyx_codeobj__9); + Py_CLEAR(clear_module_state->__pyx_tuple__100); + Py_CLEAR(clear_module_state->__pyx_codeobj__10); + Py_CLEAR(clear_module_state->__pyx_codeobj__11); + Py_CLEAR(clear_module_state->__pyx_codeobj__13); + Py_CLEAR(clear_module_state->__pyx_codeobj__14); + Py_CLEAR(clear_module_state->__pyx_codeobj__15); + Py_CLEAR(clear_module_state->__pyx_codeobj__16); + Py_CLEAR(clear_module_state->__pyx_codeobj__17); + Py_CLEAR(clear_module_state->__pyx_codeobj__18); + Py_CLEAR(clear_module_state->__pyx_codeobj__20); + Py_CLEAR(clear_module_state->__pyx_codeobj__21); + Py_CLEAR(clear_module_state->__pyx_codeobj__22); + Py_CLEAR(clear_module_state->__pyx_codeobj__23); + Py_CLEAR(clear_module_state->__pyx_codeobj__24); + Py_CLEAR(clear_module_state->__pyx_codeobj__25); + Py_CLEAR(clear_module_state->__pyx_codeobj__26); + Py_CLEAR(clear_module_state->__pyx_codeobj__27); + Py_CLEAR(clear_module_state->__pyx_codeobj__28); + Py_CLEAR(clear_module_state->__pyx_codeobj__29); + Py_CLEAR(clear_module_state->__pyx_codeobj__30); + Py_CLEAR(clear_module_state->__pyx_codeobj__31); + Py_CLEAR(clear_module_state->__pyx_codeobj__32); + Py_CLEAR(clear_module_state->__pyx_codeobj__33); + Py_CLEAR(clear_module_state->__pyx_codeobj__34); + Py_CLEAR(clear_module_state->__pyx_codeobj__35); + Py_CLEAR(clear_module_state->__pyx_codeobj__36); + Py_CLEAR(clear_module_state->__pyx_codeobj__37); + Py_CLEAR(clear_module_state->__pyx_codeobj__38); + Py_CLEAR(clear_module_state->__pyx_codeobj__39); + Py_CLEAR(clear_module_state->__pyx_codeobj__40); + Py_CLEAR(clear_module_state->__pyx_codeobj__41); + Py_CLEAR(clear_module_state->__pyx_codeobj__44); + Py_CLEAR(clear_module_state->__pyx_codeobj__46); + Py_CLEAR(clear_module_state->__pyx_codeobj__47); + Py_CLEAR(clear_module_state->__pyx_codeobj__48); + Py_CLEAR(clear_module_state->__pyx_codeobj__49); + Py_CLEAR(clear_module_state->__pyx_codeobj__50); + Py_CLEAR(clear_module_state->__pyx_codeobj__51); + Py_CLEAR(clear_module_state->__pyx_codeobj__52); + Py_CLEAR(clear_module_state->__pyx_codeobj__53); + Py_CLEAR(clear_module_state->__pyx_codeobj__54); + Py_CLEAR(clear_module_state->__pyx_codeobj__55); + Py_CLEAR(clear_module_state->__pyx_codeobj__56); + Py_CLEAR(clear_module_state->__pyx_codeobj__57); + Py_CLEAR(clear_module_state->__pyx_codeobj__58); + Py_CLEAR(clear_module_state->__pyx_codeobj__59); + Py_CLEAR(clear_module_state->__pyx_codeobj__60); + Py_CLEAR(clear_module_state->__pyx_codeobj__61); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosConnection); + Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosConnection); + Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosField); + Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosField); + Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosResult); + Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosResult); + Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosCursor); + Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosCursor); + Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosTopicAssignment); + Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosTopicAssignment); + Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosConsumer); + Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosConsumer); + Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter); + Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter); + Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter); + Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter); + Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__); + Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__); + Py_VISIT(traverse_module_state->__pyx_n_s_CONVERT_FUNC); + Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionError); + Py_VISIT(traverse_module_state->__pyx_kp_u_Cursor_is_not_connected); + Py_VISIT(traverse_module_state->__pyx_n_s_DatabaseError); + Py_VISIT(traverse_module_state->__pyx_n_u_DictRow); + Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); + Py_VISIT(traverse_module_state->__pyx_n_s_InternalError); + Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_use_of_fetch_iterator); + Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_use_of_fetchall); + Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_use_of_rows_iter); + Py_VISIT(traverse_module_state->__pyx_n_s_OSError); + Py_VISIT(traverse_module_state->__pyx_n_s_OperationalError); + Py_VISIT(traverse_module_state->__pyx_n_s_Optional); + Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_int); + Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); + Py_VISIT(traverse_module_state->__pyx_n_s_ProgrammingError); + Py_VISIT(traverse_module_state->__pyx_n_s_SIZED_TYPE); + Py_VISIT(traverse_module_state->__pyx_n_s_StatementError); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection___reduce_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection___setstate_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection__check_conn_error); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection__init_conn); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection__init_options); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_clear_result_set); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_close); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_commit); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_execute); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_get_table_vgroup); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_load_table_info); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_query); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_query_a); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_rollback); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_select_db); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_subscribe); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer___reduce_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer___setstate_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_commit); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_committed); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_db_name); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_topic_assignmen); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_topic_name); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_vgroup_id); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_vgroup_offset); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_offset_commit); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_offset_seek); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_poll); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_position); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_result_commit); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_subscribe); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_unsubscribe); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor___iter); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor___reduce_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor___setstate_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor__reset_result); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor_close); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor_execute); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor_fetchall); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor_fetchone); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosField); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosField___reduce_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosField___setstate_cython); + Py_VISIT(traverse_module_state->__pyx_kp_u_TaosField_name); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult___reduce_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult___setstate_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult__check_result_error); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult__fetch_block); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_blocks_iter); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_fetch_all); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_fetch_all_into_dict); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_fetch_block); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_fetch_rows_a); + Py_VISIT(traverse_module_state->__pyx_kp_u_TaosResult_res); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_rows_iter); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_taos_fetch_raw_block); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosTopicAssignment); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosTopicAssignment___reduce_cyt); + Py_VISIT(traverse_module_state->__pyx_n_s_TaosTopicAssignment___setstate_c); + Py_VISIT(traverse_module_state->__pyx_n_s_TmqError); + Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); + Py_VISIT(traverse_module_state->__pyx_n_s_UNSIZED_TYPE); + Py_VISIT(traverse_module_state->__pyx_n_u_UTC); + Py_VISIT(traverse_module_state->__pyx_n_s__101); + Py_VISIT(traverse_module_state->__pyx_kp_u__12); + Py_VISIT(traverse_module_state->__pyx_kp_u__19); + Py_VISIT(traverse_module_state->__pyx_kp_u__63); + Py_VISIT(traverse_module_state->__pyx_n_s__64); + Py_VISIT(traverse_module_state->__pyx_n_s_affected_rows); + Py_VISIT(traverse_module_state->__pyx_n_s_args); + Py_VISIT(traverse_module_state->__pyx_n_s_asdict); + Py_VISIT(traverse_module_state->__pyx_n_s_assignment); + Py_VISIT(traverse_module_state->__pyx_n_s_assignment_ptr); + Py_VISIT(traverse_module_state->__pyx_n_s_astimezone); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_n_s_b); + Py_VISIT(traverse_module_state->__pyx_n_s_begin); + Py_VISIT(traverse_module_state->__pyx_n_s_block); + Py_VISIT(traverse_module_state->__pyx_n_s_blocks); + Py_VISIT(traverse_module_state->__pyx_n_s_blocks_iter); + Py_VISIT(traverse_module_state->__pyx_n_s_bytes); + Py_VISIT(traverse_module_state->__pyx_kp_u_bytes_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_callback); + Py_VISIT(traverse_module_state->__pyx_n_s_callback_2); + Py_VISIT(traverse_module_state->__pyx_n_s_check_conn_error); + Py_VISIT(traverse_module_state->__pyx_n_s_check_result_error); + Py_VISIT(traverse_module_state->__pyx_n_s_clear_result_set); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_close); + Py_VISIT(traverse_module_state->__pyx_n_s_code); + Py_VISIT(traverse_module_state->__pyx_n_s_collections); + Py_VISIT(traverse_module_state->__pyx_n_s_commit); + Py_VISIT(traverse_module_state->__pyx_n_s_committed); + Py_VISIT(traverse_module_state->__pyx_n_s_config); + Py_VISIT(traverse_module_state->__pyx_n_s_configs); + Py_VISIT(traverse_module_state->__pyx_n_s_connection); + Py_VISIT(traverse_module_state->__pyx_n_s_current_offset); + Py_VISIT(traverse_module_state->__pyx_n_u_d); + Py_VISIT(traverse_module_state->__pyx_n_s_data); + Py_VISIT(traverse_module_state->__pyx_n_s_database); + Py_VISIT(traverse_module_state->__pyx_n_s_database_2); + Py_VISIT(traverse_module_state->__pyx_n_s_datetime); + Py_VISIT(traverse_module_state->__pyx_n_s_datetime_epoch); + Py_VISIT(traverse_module_state->__pyx_n_s_db); + Py_VISIT(traverse_module_state->__pyx_n_s_db_2); + Py_VISIT(traverse_module_state->__pyx_n_s_decode); + Py_VISIT(traverse_module_state->__pyx_n_s_dict); + Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); + Py_VISIT(traverse_module_state->__pyx_n_s_dict_row_cls); + Py_VISIT(traverse_module_state->__pyx_kp_s_dict_str_str); + Py_VISIT(traverse_module_state->__pyx_kp_u_disable); + Py_VISIT(traverse_module_state->__pyx_n_s_dt); + Py_VISIT(traverse_module_state->__pyx_n_s_dt_epoch); + Py_VISIT(traverse_module_state->__pyx_kp_u_enable); + Py_VISIT(traverse_module_state->__pyx_n_s_encode); + Py_VISIT(traverse_module_state->__pyx_n_s_end); + Py_VISIT(traverse_module_state->__pyx_n_s_errno); + Py_VISIT(traverse_module_state->__pyx_n_s_errstr); + Py_VISIT(traverse_module_state->__pyx_n_s_execute); + Py_VISIT(traverse_module_state->__pyx_n_s_f); + Py_VISIT(traverse_module_state->__pyx_n_s_fetch_all); + Py_VISIT(traverse_module_state->__pyx_n_s_fetch_all_into_dict); + Py_VISIT(traverse_module_state->__pyx_n_s_fetch_block); + Py_VISIT(traverse_module_state->__pyx_n_s_fetch_block_2); + Py_VISIT(traverse_module_state->__pyx_n_s_fetch_rows_a); + Py_VISIT(traverse_module_state->__pyx_n_s_fetchall); + Py_VISIT(traverse_module_state->__pyx_n_s_fetchone); + Py_VISIT(traverse_module_state->__pyx_n_s_field); + Py_VISIT(traverse_module_state->__pyx_n_s_field_names); + Py_VISIT(traverse_module_state->__pyx_n_s_fields); + Py_VISIT(traverse_module_state->__pyx_n_s_fromtimestamp); + Py_VISIT(traverse_module_state->__pyx_kp_u_gc); + Py_VISIT(traverse_module_state->__pyx_n_s_get_db_name); + Py_VISIT(traverse_module_state->__pyx_n_s_get_table_vgroup_id); + Py_VISIT(traverse_module_state->__pyx_n_s_get_topic_assignment); + Py_VISIT(traverse_module_state->__pyx_n_s_get_topic_name); + Py_VISIT(traverse_module_state->__pyx_n_s_get_vgroup_id); + Py_VISIT(traverse_module_state->__pyx_n_s_get_vgroup_offset); + Py_VISIT(traverse_module_state->__pyx_n_s_getstate); + Py_VISIT(traverse_module_state->__pyx_n_s_host); + Py_VISIT(traverse_module_state->__pyx_n_s_i); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_init_conn); + Py_VISIT(traverse_module_state->__pyx_n_s_init_options); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_n_s_int); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_n_s_is_null); + Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); + Py_VISIT(traverse_module_state->__pyx_n_s_items); + Py_VISIT(traverse_module_state->__pyx_n_s_iter); + Py_VISIT(traverse_module_state->__pyx_n_s_k); + Py_VISIT(traverse_module_state->__pyx_n_s_k_2); + Py_VISIT(traverse_module_state->__pyx_n_s_list); + Py_VISIT(traverse_module_state->__pyx_kp_s_list_str); + Py_VISIT(traverse_module_state->__pyx_n_s_load_table_info); + Py_VISIT(traverse_module_state->__pyx_n_s_localize); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_map); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_name_2); + Py_VISIT(traverse_module_state->__pyx_n_s_namedtuple); + Py_VISIT(traverse_module_state->__pyx_n_s_new); + Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); + Py_VISIT(traverse_module_state->__pyx_n_s_num_of_assignment); + Py_VISIT(traverse_module_state->__pyx_n_s_num_of_rows); + Py_VISIT(traverse_module_state->__pyx_n_s_offset); + Py_VISIT(traverse_module_state->__pyx_n_s_offset_commit); + Py_VISIT(traverse_module_state->__pyx_n_s_offset_seek); + Py_VISIT(traverse_module_state->__pyx_n_s_offsets); + Py_VISIT(traverse_module_state->__pyx_n_s_params); + Py_VISIT(traverse_module_state->__pyx_n_s_password); + Py_VISIT(traverse_module_state->__pyx_n_s_pblock); + Py_VISIT(traverse_module_state->__pyx_n_s_pickle); + Py_VISIT(traverse_module_state->__pyx_n_s_poll); + Py_VISIT(traverse_module_state->__pyx_n_s_port); + Py_VISIT(traverse_module_state->__pyx_n_s_pos); + Py_VISIT(traverse_module_state->__pyx_n_s_position); + Py_VISIT(traverse_module_state->__pyx_n_s_print); + Py_VISIT(traverse_module_state->__pyx_n_s_priv_datetime_epoch); + Py_VISIT(traverse_module_state->__pyx_n_s_priv_tz); + Py_VISIT(traverse_module_state->__pyx_n_s_pytz); + Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); + Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); + Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); + Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); + Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); + Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_TaosCursor); + Py_VISIT(traverse_module_state->__pyx_n_s_query); + Py_VISIT(traverse_module_state->__pyx_n_s_query_a); + Py_VISIT(traverse_module_state->__pyx_n_s_r); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_reduce); + Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); + Py_VISIT(traverse_module_state->__pyx_n_s_req_id); + Py_VISIT(traverse_module_state->__pyx_n_s_res); + Py_VISIT(traverse_module_state->__pyx_n_s_reset_result); + Py_VISIT(traverse_module_state->__pyx_n_s_result_commit); + Py_VISIT(traverse_module_state->__pyx_n_s_rollback); + Py_VISIT(traverse_module_state->__pyx_n_u_root); + Py_VISIT(traverse_module_state->__pyx_n_s_row); + Py_VISIT(traverse_module_state->__pyx_n_s_row_count); + Py_VISIT(traverse_module_state->__pyx_n_s_rows_iter); + Py_VISIT(traverse_module_state->__pyx_n_s_seconds); + Py_VISIT(traverse_module_state->__pyx_kp_u_select_database_error); + Py_VISIT(traverse_module_state->__pyx_n_s_select_db); + Py_VISIT(traverse_module_state->__pyx_n_s_self); + Py_VISIT(traverse_module_state->__pyx_n_s_send); + Py_VISIT(traverse_module_state->__pyx_n_s_set_tz); + Py_VISIT(traverse_module_state->__pyx_kp_u_set_up_tmq_config_failed); + Py_VISIT(traverse_module_state->__pyx_kp_u_set_up_tmq_list_failed); + Py_VISIT(traverse_module_state->__pyx_n_s_setstate); + Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); + Py_VISIT(traverse_module_state->__pyx_kp_u_setup_tmq_failed); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_n_s_sql); + Py_VISIT(traverse_module_state->__pyx_n_s_sql_2); + Py_VISIT(traverse_module_state->__pyx_n_s_state); + Py_VISIT(traverse_module_state->__pyx_n_s_str); + Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); + Py_VISIT(traverse_module_state->__pyx_n_s_subscribe); + Py_VISIT(traverse_module_state->__pyx_n_s_table); + Py_VISIT(traverse_module_state->__pyx_n_s_table_2); + Py_VISIT(traverse_module_state->__pyx_n_s_tables); + Py_VISIT(traverse_module_state->__pyx_n_s_tables_2); + Py_VISIT(traverse_module_state->__pyx_n_s_taos__cinterface); + Py_VISIT(traverse_module_state->__pyx_n_s_taos__objects); + Py_VISIT(traverse_module_state->__pyx_kp_s_taos__objects_pyx); + Py_VISIT(traverse_module_state->__pyx_n_s_taos_error); + Py_VISIT(traverse_module_state->__pyx_n_s_taos_fetch_raw_block_a); + Py_VISIT(traverse_module_state->__pyx_n_s_taos_res); + Py_VISIT(traverse_module_state->__pyx_n_s_taos_row); + Py_VISIT(traverse_module_state->__pyx_n_u_taosdata); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_throw); + Py_VISIT(traverse_module_state->__pyx_n_s_timedelta); + Py_VISIT(traverse_module_state->__pyx_n_s_timeout); + Py_VISIT(traverse_module_state->__pyx_n_s_timezone); + Py_VISIT(traverse_module_state->__pyx_n_s_tmq_conf); + Py_VISIT(traverse_module_state->__pyx_kp_u_tmq_conf_res); + Py_VISIT(traverse_module_state->__pyx_n_s_tmq_conf_res_2); + Py_VISIT(traverse_module_state->__pyx_n_s_tmq_errno); + Py_VISIT(traverse_module_state->__pyx_n_s_tmq_list); + Py_VISIT(traverse_module_state->__pyx_n_s_topic); + Py_VISIT(traverse_module_state->__pyx_n_s_topic_2); + Py_VISIT(traverse_module_state->__pyx_n_s_topic_assignments); + Py_VISIT(traverse_module_state->__pyx_n_s_topics); + Py_VISIT(traverse_module_state->__pyx_n_s_tp); + Py_VISIT(traverse_module_state->__pyx_n_s_tp_2); + Py_VISIT(traverse_module_state->__pyx_n_s_tta); + Py_VISIT(traverse_module_state->__pyx_n_s_type); + Py_VISIT(traverse_module_state->__pyx_kp_u_type_2); + Py_VISIT(traverse_module_state->__pyx_n_s_type_3); + Py_VISIT(traverse_module_state->__pyx_n_s_typing); + Py_VISIT(traverse_module_state->__pyx_n_s_tz); + Py_VISIT(traverse_module_state->__pyx_n_s_unsubscribe); + Py_VISIT(traverse_module_state->__pyx_n_s_update); + Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); + Py_VISIT(traverse_module_state->__pyx_n_s_user); + Py_VISIT(traverse_module_state->__pyx_n_s_utc_datetime_epoch); + Py_VISIT(traverse_module_state->__pyx_n_s_utc_tz); + Py_VISIT(traverse_module_state->__pyx_n_s_utcfromtimestamp); + Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); + Py_VISIT(traverse_module_state->__pyx_n_s_v); + Py_VISIT(traverse_module_state->__pyx_n_s_v_2); + Py_VISIT(traverse_module_state->__pyx_n_s_vg_id); + Py_VISIT(traverse_module_state->__pyx_n_s_zip); + Py_VISIT(traverse_module_state->__pyx_int_0); + Py_VISIT(traverse_module_state->__pyx_int_1); + Py_VISIT(traverse_module_state->__pyx_int_86400); + Py_VISIT(traverse_module_state->__pyx_int_17084266); + Py_VISIT(traverse_module_state->__pyx_int_126557407); + Py_VISIT(traverse_module_state->__pyx_int_199624353); + Py_VISIT(traverse_module_state->__pyx_codeobj_); + Py_VISIT(traverse_module_state->__pyx_tuple__42); + Py_VISIT(traverse_module_state->__pyx_tuple__43); + Py_VISIT(traverse_module_state->__pyx_tuple__45); + Py_VISIT(traverse_module_state->__pyx_tuple__62); + Py_VISIT(traverse_module_state->__pyx_tuple__65); + Py_VISIT(traverse_module_state->__pyx_tuple__66); + Py_VISIT(traverse_module_state->__pyx_tuple__67); + Py_VISIT(traverse_module_state->__pyx_tuple__68); + Py_VISIT(traverse_module_state->__pyx_tuple__69); + Py_VISIT(traverse_module_state->__pyx_tuple__70); + Py_VISIT(traverse_module_state->__pyx_tuple__71); + Py_VISIT(traverse_module_state->__pyx_tuple__72); + Py_VISIT(traverse_module_state->__pyx_tuple__73); + Py_VISIT(traverse_module_state->__pyx_tuple__74); + Py_VISIT(traverse_module_state->__pyx_tuple__75); + Py_VISIT(traverse_module_state->__pyx_tuple__76); + Py_VISIT(traverse_module_state->__pyx_tuple__77); + Py_VISIT(traverse_module_state->__pyx_tuple__78); + Py_VISIT(traverse_module_state->__pyx_tuple__79); + Py_VISIT(traverse_module_state->__pyx_tuple__80); + Py_VISIT(traverse_module_state->__pyx_tuple__81); + Py_VISIT(traverse_module_state->__pyx_tuple__82); + Py_VISIT(traverse_module_state->__pyx_tuple__83); + Py_VISIT(traverse_module_state->__pyx_tuple__84); + Py_VISIT(traverse_module_state->__pyx_tuple__85); + Py_VISIT(traverse_module_state->__pyx_tuple__86); + Py_VISIT(traverse_module_state->__pyx_tuple__87); + Py_VISIT(traverse_module_state->__pyx_tuple__88); + Py_VISIT(traverse_module_state->__pyx_tuple__89); + Py_VISIT(traverse_module_state->__pyx_tuple__90); + Py_VISIT(traverse_module_state->__pyx_tuple__91); + Py_VISIT(traverse_module_state->__pyx_tuple__92); + Py_VISIT(traverse_module_state->__pyx_tuple__93); + Py_VISIT(traverse_module_state->__pyx_tuple__94); + Py_VISIT(traverse_module_state->__pyx_tuple__95); + Py_VISIT(traverse_module_state->__pyx_tuple__96); + Py_VISIT(traverse_module_state->__pyx_tuple__97); + Py_VISIT(traverse_module_state->__pyx_tuple__98); + Py_VISIT(traverse_module_state->__pyx_tuple__99); + Py_VISIT(traverse_module_state->__pyx_codeobj__2); + Py_VISIT(traverse_module_state->__pyx_codeobj__3); + Py_VISIT(traverse_module_state->__pyx_codeobj__4); + Py_VISIT(traverse_module_state->__pyx_codeobj__5); + Py_VISIT(traverse_module_state->__pyx_codeobj__6); + Py_VISIT(traverse_module_state->__pyx_codeobj__7); + Py_VISIT(traverse_module_state->__pyx_codeobj__8); + Py_VISIT(traverse_module_state->__pyx_codeobj__9); + Py_VISIT(traverse_module_state->__pyx_tuple__100); + Py_VISIT(traverse_module_state->__pyx_codeobj__10); + Py_VISIT(traverse_module_state->__pyx_codeobj__11); + Py_VISIT(traverse_module_state->__pyx_codeobj__13); + Py_VISIT(traverse_module_state->__pyx_codeobj__14); + Py_VISIT(traverse_module_state->__pyx_codeobj__15); + Py_VISIT(traverse_module_state->__pyx_codeobj__16); + Py_VISIT(traverse_module_state->__pyx_codeobj__17); + Py_VISIT(traverse_module_state->__pyx_codeobj__18); + Py_VISIT(traverse_module_state->__pyx_codeobj__20); + Py_VISIT(traverse_module_state->__pyx_codeobj__21); + Py_VISIT(traverse_module_state->__pyx_codeobj__22); + Py_VISIT(traverse_module_state->__pyx_codeobj__23); + Py_VISIT(traverse_module_state->__pyx_codeobj__24); + Py_VISIT(traverse_module_state->__pyx_codeobj__25); + Py_VISIT(traverse_module_state->__pyx_codeobj__26); + Py_VISIT(traverse_module_state->__pyx_codeobj__27); + Py_VISIT(traverse_module_state->__pyx_codeobj__28); + Py_VISIT(traverse_module_state->__pyx_codeobj__29); + Py_VISIT(traverse_module_state->__pyx_codeobj__30); + Py_VISIT(traverse_module_state->__pyx_codeobj__31); + Py_VISIT(traverse_module_state->__pyx_codeobj__32); + Py_VISIT(traverse_module_state->__pyx_codeobj__33); + Py_VISIT(traverse_module_state->__pyx_codeobj__34); + Py_VISIT(traverse_module_state->__pyx_codeobj__35); + Py_VISIT(traverse_module_state->__pyx_codeobj__36); + Py_VISIT(traverse_module_state->__pyx_codeobj__37); + Py_VISIT(traverse_module_state->__pyx_codeobj__38); + Py_VISIT(traverse_module_state->__pyx_codeobj__39); + Py_VISIT(traverse_module_state->__pyx_codeobj__40); + Py_VISIT(traverse_module_state->__pyx_codeobj__41); + Py_VISIT(traverse_module_state->__pyx_codeobj__44); + Py_VISIT(traverse_module_state->__pyx_codeobj__46); + Py_VISIT(traverse_module_state->__pyx_codeobj__47); + Py_VISIT(traverse_module_state->__pyx_codeobj__48); + Py_VISIT(traverse_module_state->__pyx_codeobj__49); + Py_VISIT(traverse_module_state->__pyx_codeobj__50); + Py_VISIT(traverse_module_state->__pyx_codeobj__51); + Py_VISIT(traverse_module_state->__pyx_codeobj__52); + Py_VISIT(traverse_module_state->__pyx_codeobj__53); + Py_VISIT(traverse_module_state->__pyx_codeobj__54); + Py_VISIT(traverse_module_state->__pyx_codeobj__55); + Py_VISIT(traverse_module_state->__pyx_codeobj__56); + Py_VISIT(traverse_module_state->__pyx_codeobj__57); + Py_VISIT(traverse_module_state->__pyx_codeobj__58); + Py_VISIT(traverse_module_state->__pyx_codeobj__59); + Py_VISIT(traverse_module_state->__pyx_codeobj__60); + Py_VISIT(traverse_module_state->__pyx_codeobj__61); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#define __pyx_type_4taos_8_objects_TaosConnection __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosConnection +#define __pyx_type_4taos_8_objects_TaosField __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosField +#define __pyx_type_4taos_8_objects_TaosResult __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosResult +#define __pyx_type_4taos_8_objects_TaosCursor __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosCursor +#define __pyx_type_4taos_8_objects_TaosTopicAssignment __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosTopicAssignment +#define __pyx_type_4taos_8_objects_TaosConsumer __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosConsumer +#define __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter __pyx_mstate_global->__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter +#define __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter __pyx_mstate_global->__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter +#define __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__ __pyx_mstate_global->__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__ +#endif +#define __pyx_ptype_4taos_8_objects_TaosConnection __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosConnection +#define __pyx_ptype_4taos_8_objects_TaosField __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosField +#define __pyx_ptype_4taos_8_objects_TaosResult __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosResult +#define __pyx_ptype_4taos_8_objects_TaosCursor __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosCursor +#define __pyx_ptype_4taos_8_objects_TaosTopicAssignment __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosTopicAssignment +#define __pyx_ptype_4taos_8_objects_TaosConsumer __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosConsumer +#define __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter __pyx_mstate_global->__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter +#define __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter __pyx_mstate_global->__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter +#define __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__ __pyx_mstate_global->__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__ +#define __pyx_n_s_CONVERT_FUNC __pyx_mstate_global->__pyx_n_s_CONVERT_FUNC +#define __pyx_n_s_ConnectionError __pyx_mstate_global->__pyx_n_s_ConnectionError +#define __pyx_kp_u_Cursor_is_not_connected __pyx_mstate_global->__pyx_kp_u_Cursor_is_not_connected +#define __pyx_n_s_DatabaseError __pyx_mstate_global->__pyx_n_s_DatabaseError +#define __pyx_n_u_DictRow __pyx_mstate_global->__pyx_n_u_DictRow +#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 +#define __pyx_n_s_InternalError __pyx_mstate_global->__pyx_n_s_InternalError +#define __pyx_kp_u_Invalid_use_of_fetch_iterator __pyx_mstate_global->__pyx_kp_u_Invalid_use_of_fetch_iterator +#define __pyx_kp_u_Invalid_use_of_fetchall __pyx_mstate_global->__pyx_kp_u_Invalid_use_of_fetchall +#define __pyx_kp_u_Invalid_use_of_rows_iter __pyx_mstate_global->__pyx_kp_u_Invalid_use_of_rows_iter +#define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError +#define __pyx_n_s_OperationalError __pyx_mstate_global->__pyx_n_s_OperationalError +#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional +#define __pyx_kp_s_Optional_int __pyx_mstate_global->__pyx_kp_s_Optional_int +#define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError +#define __pyx_n_s_ProgrammingError __pyx_mstate_global->__pyx_n_s_ProgrammingError +#define __pyx_n_s_SIZED_TYPE __pyx_mstate_global->__pyx_n_s_SIZED_TYPE +#define __pyx_n_s_StatementError __pyx_mstate_global->__pyx_n_s_StatementError +#define __pyx_n_s_TaosConnection __pyx_mstate_global->__pyx_n_s_TaosConnection +#define __pyx_n_s_TaosConnection___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosConnection___reduce_cython +#define __pyx_n_s_TaosConnection___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosConnection___setstate_cython +#define __pyx_n_s_TaosConnection__check_conn_error __pyx_mstate_global->__pyx_n_s_TaosConnection__check_conn_error +#define __pyx_n_s_TaosConnection__init_conn __pyx_mstate_global->__pyx_n_s_TaosConnection__init_conn +#define __pyx_n_s_TaosConnection__init_options __pyx_mstate_global->__pyx_n_s_TaosConnection__init_options +#define __pyx_n_s_TaosConnection_clear_result_set __pyx_mstate_global->__pyx_n_s_TaosConnection_clear_result_set +#define __pyx_n_s_TaosConnection_close __pyx_mstate_global->__pyx_n_s_TaosConnection_close +#define __pyx_n_s_TaosConnection_commit __pyx_mstate_global->__pyx_n_s_TaosConnection_commit +#define __pyx_n_s_TaosConnection_execute __pyx_mstate_global->__pyx_n_s_TaosConnection_execute +#define __pyx_n_s_TaosConnection_get_table_vgroup __pyx_mstate_global->__pyx_n_s_TaosConnection_get_table_vgroup +#define __pyx_n_s_TaosConnection_load_table_info __pyx_mstate_global->__pyx_n_s_TaosConnection_load_table_info +#define __pyx_n_s_TaosConnection_query __pyx_mstate_global->__pyx_n_s_TaosConnection_query +#define __pyx_n_s_TaosConnection_query_a __pyx_mstate_global->__pyx_n_s_TaosConnection_query_a +#define __pyx_n_s_TaosConnection_rollback __pyx_mstate_global->__pyx_n_s_TaosConnection_rollback +#define __pyx_n_s_TaosConnection_select_db __pyx_mstate_global->__pyx_n_s_TaosConnection_select_db +#define __pyx_n_s_TaosConnection_subscribe __pyx_mstate_global->__pyx_n_s_TaosConnection_subscribe +#define __pyx_n_s_TaosConsumer __pyx_mstate_global->__pyx_n_s_TaosConsumer +#define __pyx_n_s_TaosConsumer___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosConsumer___reduce_cython +#define __pyx_n_s_TaosConsumer___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosConsumer___setstate_cython +#define __pyx_n_s_TaosConsumer_commit __pyx_mstate_global->__pyx_n_s_TaosConsumer_commit +#define __pyx_n_s_TaosConsumer_committed __pyx_mstate_global->__pyx_n_s_TaosConsumer_committed +#define __pyx_n_s_TaosConsumer_get_db_name __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_db_name +#define __pyx_n_s_TaosConsumer_get_topic_assignmen __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_topic_assignmen +#define __pyx_n_s_TaosConsumer_get_topic_name __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_topic_name +#define __pyx_n_s_TaosConsumer_get_vgroup_id __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_vgroup_id +#define __pyx_n_s_TaosConsumer_get_vgroup_offset __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_vgroup_offset +#define __pyx_n_s_TaosConsumer_offset_commit __pyx_mstate_global->__pyx_n_s_TaosConsumer_offset_commit +#define __pyx_n_s_TaosConsumer_offset_seek __pyx_mstate_global->__pyx_n_s_TaosConsumer_offset_seek +#define __pyx_n_s_TaosConsumer_poll __pyx_mstate_global->__pyx_n_s_TaosConsumer_poll +#define __pyx_n_s_TaosConsumer_position __pyx_mstate_global->__pyx_n_s_TaosConsumer_position +#define __pyx_n_s_TaosConsumer_result_commit __pyx_mstate_global->__pyx_n_s_TaosConsumer_result_commit +#define __pyx_n_s_TaosConsumer_subscribe __pyx_mstate_global->__pyx_n_s_TaosConsumer_subscribe +#define __pyx_n_s_TaosConsumer_unsubscribe __pyx_mstate_global->__pyx_n_s_TaosConsumer_unsubscribe +#define __pyx_n_s_TaosCursor __pyx_mstate_global->__pyx_n_s_TaosCursor +#define __pyx_n_s_TaosCursor___iter __pyx_mstate_global->__pyx_n_s_TaosCursor___iter +#define __pyx_n_s_TaosCursor___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosCursor___reduce_cython +#define __pyx_n_s_TaosCursor___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosCursor___setstate_cython +#define __pyx_n_s_TaosCursor__reset_result __pyx_mstate_global->__pyx_n_s_TaosCursor__reset_result +#define __pyx_n_s_TaosCursor_close __pyx_mstate_global->__pyx_n_s_TaosCursor_close +#define __pyx_n_s_TaosCursor_execute __pyx_mstate_global->__pyx_n_s_TaosCursor_execute +#define __pyx_n_s_TaosCursor_fetchall __pyx_mstate_global->__pyx_n_s_TaosCursor_fetchall +#define __pyx_n_s_TaosCursor_fetchone __pyx_mstate_global->__pyx_n_s_TaosCursor_fetchone +#define __pyx_n_s_TaosField __pyx_mstate_global->__pyx_n_s_TaosField +#define __pyx_n_s_TaosField___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosField___reduce_cython +#define __pyx_n_s_TaosField___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosField___setstate_cython +#define __pyx_kp_u_TaosField_name __pyx_mstate_global->__pyx_kp_u_TaosField_name +#define __pyx_n_s_TaosResult __pyx_mstate_global->__pyx_n_s_TaosResult +#define __pyx_n_s_TaosResult___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosResult___reduce_cython +#define __pyx_n_s_TaosResult___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosResult___setstate_cython +#define __pyx_n_s_TaosResult__check_result_error __pyx_mstate_global->__pyx_n_s_TaosResult__check_result_error +#define __pyx_n_s_TaosResult__fetch_block __pyx_mstate_global->__pyx_n_s_TaosResult__fetch_block +#define __pyx_n_s_TaosResult_blocks_iter __pyx_mstate_global->__pyx_n_s_TaosResult_blocks_iter +#define __pyx_n_s_TaosResult_fetch_all __pyx_mstate_global->__pyx_n_s_TaosResult_fetch_all +#define __pyx_n_s_TaosResult_fetch_all_into_dict __pyx_mstate_global->__pyx_n_s_TaosResult_fetch_all_into_dict +#define __pyx_n_s_TaosResult_fetch_block __pyx_mstate_global->__pyx_n_s_TaosResult_fetch_block +#define __pyx_n_s_TaosResult_fetch_rows_a __pyx_mstate_global->__pyx_n_s_TaosResult_fetch_rows_a +#define __pyx_kp_u_TaosResult_res __pyx_mstate_global->__pyx_kp_u_TaosResult_res +#define __pyx_n_s_TaosResult_rows_iter __pyx_mstate_global->__pyx_n_s_TaosResult_rows_iter +#define __pyx_n_s_TaosResult_taos_fetch_raw_block __pyx_mstate_global->__pyx_n_s_TaosResult_taos_fetch_raw_block +#define __pyx_n_s_TaosTopicAssignment __pyx_mstate_global->__pyx_n_s_TaosTopicAssignment +#define __pyx_n_s_TaosTopicAssignment___reduce_cyt __pyx_mstate_global->__pyx_n_s_TaosTopicAssignment___reduce_cyt +#define __pyx_n_s_TaosTopicAssignment___setstate_c __pyx_mstate_global->__pyx_n_s_TaosTopicAssignment___setstate_c +#define __pyx_n_s_TmqError __pyx_mstate_global->__pyx_n_s_TmqError +#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError +#define __pyx_n_s_UNSIZED_TYPE __pyx_mstate_global->__pyx_n_s_UNSIZED_TYPE +#define __pyx_n_u_UTC __pyx_mstate_global->__pyx_n_u_UTC +#define __pyx_n_s__101 __pyx_mstate_global->__pyx_n_s__101 +#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 +#define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19 +#define __pyx_kp_u__63 __pyx_mstate_global->__pyx_kp_u__63 +#define __pyx_n_s__64 __pyx_mstate_global->__pyx_n_s__64 +#define __pyx_n_s_affected_rows __pyx_mstate_global->__pyx_n_s_affected_rows +#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args +#define __pyx_n_s_asdict __pyx_mstate_global->__pyx_n_s_asdict +#define __pyx_n_s_assignment __pyx_mstate_global->__pyx_n_s_assignment +#define __pyx_n_s_assignment_ptr __pyx_mstate_global->__pyx_n_s_assignment_ptr +#define __pyx_n_s_astimezone __pyx_mstate_global->__pyx_n_s_astimezone +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b +#define __pyx_n_s_begin __pyx_mstate_global->__pyx_n_s_begin +#define __pyx_n_s_block __pyx_mstate_global->__pyx_n_s_block +#define __pyx_n_s_blocks __pyx_mstate_global->__pyx_n_s_blocks +#define __pyx_n_s_blocks_iter __pyx_mstate_global->__pyx_n_s_blocks_iter +#define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes +#define __pyx_kp_u_bytes_2 __pyx_mstate_global->__pyx_kp_u_bytes_2 +#define __pyx_kp_u_callback __pyx_mstate_global->__pyx_kp_u_callback +#define __pyx_n_s_callback_2 __pyx_mstate_global->__pyx_n_s_callback_2 +#define __pyx_n_s_check_conn_error __pyx_mstate_global->__pyx_n_s_check_conn_error +#define __pyx_n_s_check_result_error __pyx_mstate_global->__pyx_n_s_check_result_error +#define __pyx_n_s_clear_result_set __pyx_mstate_global->__pyx_n_s_clear_result_set +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close +#define __pyx_n_s_code __pyx_mstate_global->__pyx_n_s_code +#define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections +#define __pyx_n_s_commit __pyx_mstate_global->__pyx_n_s_commit +#define __pyx_n_s_committed __pyx_mstate_global->__pyx_n_s_committed +#define __pyx_n_s_config __pyx_mstate_global->__pyx_n_s_config +#define __pyx_n_s_configs __pyx_mstate_global->__pyx_n_s_configs +#define __pyx_n_s_connection __pyx_mstate_global->__pyx_n_s_connection +#define __pyx_n_s_current_offset __pyx_mstate_global->__pyx_n_s_current_offset +#define __pyx_n_u_d __pyx_mstate_global->__pyx_n_u_d +#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data +#define __pyx_n_s_database __pyx_mstate_global->__pyx_n_s_database +#define __pyx_n_s_database_2 __pyx_mstate_global->__pyx_n_s_database_2 +#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime +#define __pyx_n_s_datetime_epoch __pyx_mstate_global->__pyx_n_s_datetime_epoch +#define __pyx_n_s_db __pyx_mstate_global->__pyx_n_s_db +#define __pyx_n_s_db_2 __pyx_mstate_global->__pyx_n_s_db_2 +#define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode +#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict +#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 +#define __pyx_n_s_dict_row_cls __pyx_mstate_global->__pyx_n_s_dict_row_cls +#define __pyx_kp_s_dict_str_str __pyx_mstate_global->__pyx_kp_s_dict_str_str +#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable +#define __pyx_n_s_dt __pyx_mstate_global->__pyx_n_s_dt +#define __pyx_n_s_dt_epoch __pyx_mstate_global->__pyx_n_s_dt_epoch +#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable +#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode +#define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end +#define __pyx_n_s_errno __pyx_mstate_global->__pyx_n_s_errno +#define __pyx_n_s_errstr __pyx_mstate_global->__pyx_n_s_errstr +#define __pyx_n_s_execute __pyx_mstate_global->__pyx_n_s_execute +#define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f +#define __pyx_n_s_fetch_all __pyx_mstate_global->__pyx_n_s_fetch_all +#define __pyx_n_s_fetch_all_into_dict __pyx_mstate_global->__pyx_n_s_fetch_all_into_dict +#define __pyx_n_s_fetch_block __pyx_mstate_global->__pyx_n_s_fetch_block +#define __pyx_n_s_fetch_block_2 __pyx_mstate_global->__pyx_n_s_fetch_block_2 +#define __pyx_n_s_fetch_rows_a __pyx_mstate_global->__pyx_n_s_fetch_rows_a +#define __pyx_n_s_fetchall __pyx_mstate_global->__pyx_n_s_fetchall +#define __pyx_n_s_fetchone __pyx_mstate_global->__pyx_n_s_fetchone +#define __pyx_n_s_field __pyx_mstate_global->__pyx_n_s_field +#define __pyx_n_s_field_names __pyx_mstate_global->__pyx_n_s_field_names +#define __pyx_n_s_fields __pyx_mstate_global->__pyx_n_s_fields +#define __pyx_n_s_fromtimestamp __pyx_mstate_global->__pyx_n_s_fromtimestamp +#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc +#define __pyx_n_s_get_db_name __pyx_mstate_global->__pyx_n_s_get_db_name +#define __pyx_n_s_get_table_vgroup_id __pyx_mstate_global->__pyx_n_s_get_table_vgroup_id +#define __pyx_n_s_get_topic_assignment __pyx_mstate_global->__pyx_n_s_get_topic_assignment +#define __pyx_n_s_get_topic_name __pyx_mstate_global->__pyx_n_s_get_topic_name +#define __pyx_n_s_get_vgroup_id __pyx_mstate_global->__pyx_n_s_get_vgroup_id +#define __pyx_n_s_get_vgroup_offset __pyx_mstate_global->__pyx_n_s_get_vgroup_offset +#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate +#define __pyx_n_s_host __pyx_mstate_global->__pyx_n_s_host +#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_init_conn __pyx_mstate_global->__pyx_n_s_init_conn +#define __pyx_n_s_init_options __pyx_mstate_global->__pyx_n_s_init_options +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_s_is_null __pyx_mstate_global->__pyx_n_s_is_null +#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled +#define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items +#define __pyx_n_s_iter __pyx_mstate_global->__pyx_n_s_iter +#define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k +#define __pyx_n_s_k_2 __pyx_mstate_global->__pyx_n_s_k_2 +#define __pyx_n_s_list __pyx_mstate_global->__pyx_n_s_list +#define __pyx_kp_s_list_str __pyx_mstate_global->__pyx_kp_s_list_str +#define __pyx_n_s_load_table_info __pyx_mstate_global->__pyx_n_s_load_table_info +#define __pyx_n_s_localize __pyx_mstate_global->__pyx_n_s_localize +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 +#define __pyx_n_s_namedtuple __pyx_mstate_global->__pyx_n_s_namedtuple +#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new +#define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non +#define __pyx_n_s_num_of_assignment __pyx_mstate_global->__pyx_n_s_num_of_assignment +#define __pyx_n_s_num_of_rows __pyx_mstate_global->__pyx_n_s_num_of_rows +#define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset +#define __pyx_n_s_offset_commit __pyx_mstate_global->__pyx_n_s_offset_commit +#define __pyx_n_s_offset_seek __pyx_mstate_global->__pyx_n_s_offset_seek +#define __pyx_n_s_offsets __pyx_mstate_global->__pyx_n_s_offsets +#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params +#define __pyx_n_s_password __pyx_mstate_global->__pyx_n_s_password +#define __pyx_n_s_pblock __pyx_mstate_global->__pyx_n_s_pblock +#define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle +#define __pyx_n_s_poll __pyx_mstate_global->__pyx_n_s_poll +#define __pyx_n_s_port __pyx_mstate_global->__pyx_n_s_port +#define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos +#define __pyx_n_s_position __pyx_mstate_global->__pyx_n_s_position +#define __pyx_n_s_print __pyx_mstate_global->__pyx_n_s_print +#define __pyx_n_s_priv_datetime_epoch __pyx_mstate_global->__pyx_n_s_priv_datetime_epoch +#define __pyx_n_s_priv_tz __pyx_mstate_global->__pyx_n_s_priv_tz +#define __pyx_n_s_pytz __pyx_mstate_global->__pyx_n_s_pytz +#define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError +#define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum +#define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result +#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state +#define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type +#define __pyx_n_s_pyx_unpickle_TaosCursor __pyx_mstate_global->__pyx_n_s_pyx_unpickle_TaosCursor +#define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query +#define __pyx_n_s_query_a __pyx_mstate_global->__pyx_n_s_query_a +#define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce +#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython +#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex +#define __pyx_n_s_req_id __pyx_mstate_global->__pyx_n_s_req_id +#define __pyx_n_s_res __pyx_mstate_global->__pyx_n_s_res +#define __pyx_n_s_reset_result __pyx_mstate_global->__pyx_n_s_reset_result +#define __pyx_n_s_result_commit __pyx_mstate_global->__pyx_n_s_result_commit +#define __pyx_n_s_rollback __pyx_mstate_global->__pyx_n_s_rollback +#define __pyx_n_u_root __pyx_mstate_global->__pyx_n_u_root +#define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row +#define __pyx_n_s_row_count __pyx_mstate_global->__pyx_n_s_row_count +#define __pyx_n_s_rows_iter __pyx_mstate_global->__pyx_n_s_rows_iter +#define __pyx_n_s_seconds __pyx_mstate_global->__pyx_n_s_seconds +#define __pyx_kp_u_select_database_error __pyx_mstate_global->__pyx_kp_u_select_database_error +#define __pyx_n_s_select_db __pyx_mstate_global->__pyx_n_s_select_db +#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self +#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send +#define __pyx_n_s_set_tz __pyx_mstate_global->__pyx_n_s_set_tz +#define __pyx_kp_u_set_up_tmq_config_failed __pyx_mstate_global->__pyx_kp_u_set_up_tmq_config_failed +#define __pyx_kp_u_set_up_tmq_list_failed __pyx_mstate_global->__pyx_kp_u_set_up_tmq_list_failed +#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate +#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython +#define __pyx_kp_u_setup_tmq_failed __pyx_mstate_global->__pyx_kp_u_setup_tmq_failed +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_n_s_sql __pyx_mstate_global->__pyx_n_s_sql +#define __pyx_n_s_sql_2 __pyx_mstate_global->__pyx_n_s_sql_2 +#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state +#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str +#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource +#define __pyx_n_s_subscribe __pyx_mstate_global->__pyx_n_s_subscribe +#define __pyx_n_s_table __pyx_mstate_global->__pyx_n_s_table +#define __pyx_n_s_table_2 __pyx_mstate_global->__pyx_n_s_table_2 +#define __pyx_n_s_tables __pyx_mstate_global->__pyx_n_s_tables +#define __pyx_n_s_tables_2 __pyx_mstate_global->__pyx_n_s_tables_2 +#define __pyx_n_s_taos__cinterface __pyx_mstate_global->__pyx_n_s_taos__cinterface +#define __pyx_n_s_taos__objects __pyx_mstate_global->__pyx_n_s_taos__objects +#define __pyx_kp_s_taos__objects_pyx __pyx_mstate_global->__pyx_kp_s_taos__objects_pyx +#define __pyx_n_s_taos_error __pyx_mstate_global->__pyx_n_s_taos_error +#define __pyx_n_s_taos_fetch_raw_block_a __pyx_mstate_global->__pyx_n_s_taos_fetch_raw_block_a +#define __pyx_n_s_taos_res __pyx_mstate_global->__pyx_n_s_taos_res +#define __pyx_n_s_taos_row __pyx_mstate_global->__pyx_n_s_taos_row +#define __pyx_n_u_taosdata __pyx_mstate_global->__pyx_n_u_taosdata +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw +#define __pyx_n_s_timedelta __pyx_mstate_global->__pyx_n_s_timedelta +#define __pyx_n_s_timeout __pyx_mstate_global->__pyx_n_s_timeout +#define __pyx_n_s_timezone __pyx_mstate_global->__pyx_n_s_timezone +#define __pyx_n_s_tmq_conf __pyx_mstate_global->__pyx_n_s_tmq_conf +#define __pyx_kp_u_tmq_conf_res __pyx_mstate_global->__pyx_kp_u_tmq_conf_res +#define __pyx_n_s_tmq_conf_res_2 __pyx_mstate_global->__pyx_n_s_tmq_conf_res_2 +#define __pyx_n_s_tmq_errno __pyx_mstate_global->__pyx_n_s_tmq_errno +#define __pyx_n_s_tmq_list __pyx_mstate_global->__pyx_n_s_tmq_list +#define __pyx_n_s_topic __pyx_mstate_global->__pyx_n_s_topic +#define __pyx_n_s_topic_2 __pyx_mstate_global->__pyx_n_s_topic_2 +#define __pyx_n_s_topic_assignments __pyx_mstate_global->__pyx_n_s_topic_assignments +#define __pyx_n_s_topics __pyx_mstate_global->__pyx_n_s_topics +#define __pyx_n_s_tp __pyx_mstate_global->__pyx_n_s_tp +#define __pyx_n_s_tp_2 __pyx_mstate_global->__pyx_n_s_tp_2 +#define __pyx_n_s_tta __pyx_mstate_global->__pyx_n_s_tta +#define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type +#define __pyx_kp_u_type_2 __pyx_mstate_global->__pyx_kp_u_type_2 +#define __pyx_n_s_type_3 __pyx_mstate_global->__pyx_n_s_type_3 +#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing +#define __pyx_n_s_tz __pyx_mstate_global->__pyx_n_s_tz +#define __pyx_n_s_unsubscribe __pyx_mstate_global->__pyx_n_s_unsubscribe +#define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update +#define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate +#define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user +#define __pyx_n_s_utc_datetime_epoch __pyx_mstate_global->__pyx_n_s_utc_datetime_epoch +#define __pyx_n_s_utc_tz __pyx_mstate_global->__pyx_n_s_utc_tz +#define __pyx_n_s_utcfromtimestamp __pyx_mstate_global->__pyx_n_s_utcfromtimestamp +#define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 +#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v +#define __pyx_n_s_v_2 __pyx_mstate_global->__pyx_n_s_v_2 +#define __pyx_n_s_vg_id __pyx_mstate_global->__pyx_n_s_vg_id +#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip +#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 +#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 +#define __pyx_int_86400 __pyx_mstate_global->__pyx_int_86400 +#define __pyx_int_17084266 __pyx_mstate_global->__pyx_int_17084266 +#define __pyx_int_126557407 __pyx_mstate_global->__pyx_int_126557407 +#define __pyx_int_199624353 __pyx_mstate_global->__pyx_int_199624353 +#define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ +#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 +#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 +#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 +#define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 +#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 +#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 +#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 +#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 +#define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 +#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 +#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 +#define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 +#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 +#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 +#define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 +#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 +#define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 +#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 +#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 +#define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80 +#define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 +#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82 +#define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 +#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 +#define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85 +#define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86 +#define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 +#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88 +#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 +#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90 +#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 +#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92 +#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 +#define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94 +#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 +#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96 +#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 +#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98 +#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99 +#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 +#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 +#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 +#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 +#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 +#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 +#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 +#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 +#define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 +#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 +#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 +#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 +#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 +#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 +#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 +#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 +#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 +#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 +#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 +#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 +#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 +#define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 +#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 +#define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 +#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 +#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 +#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 +#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 +#define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 +#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 +#define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 +#define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 +#define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 +#define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 +#define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 +#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 +#define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 +#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 +#define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 +#define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 +#define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 +#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 +#define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 +#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 +#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 +#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 +#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 +#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 +#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 +#define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 +#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 +#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 +#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 +#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 +#define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 +#define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 +/* #### Code section: module_code ### */ + +/* "taos/_objects.pyx":22 + * + * + * def set_tz(tz): # <<<<<<<<<<<<<< + * global _priv_tz, _priv_datetime_epoch + * _priv_tz = tz + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_1set_tz(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_set_tz, "set_tz(tz)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_1set_tz = {"set_tz", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_1set_tz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_set_tz}; +static PyObject *__pyx_pw_4taos_8_objects_1set_tz(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_tz = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_tz (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tz,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_tz") < 0)) __PYX_ERR(0, 22, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_tz = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_tz", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 22, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.set_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_set_tz(__pyx_self, __pyx_v_tz); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_set_tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj_) + __Pyx_RefNannySetupContext("set_tz", 0); + __Pyx_TraceCall("set_tz", __pyx_f[0], 22, 0, __PYX_ERR(0, 22, __pyx_L1_error)); + + /* "taos/_objects.pyx":24 + * def set_tz(tz): + * global _priv_tz, _priv_datetime_epoch + * _priv_tz = tz # <<<<<<<<<<<<<< + * _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_priv_tz, __pyx_v_tz) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + + /* "taos/_objects.pyx":25 + * global _priv_tz, _priv_datetime_epoch + * _priv_tz = tz + * _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_utc_datetime_epoch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astimezone); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_priv_tz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (PyDict_SetItem(__pyx_d, __pyx_n_s_priv_datetime_epoch, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_objects.pyx":22 + * + * + * def set_tz(tz): # <<<<<<<<<<<<<< + * global _priv_tz, _priv_datetime_epoch + * _priv_tz = tz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("taos._objects.set_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":28 + * + * + * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: # <<<<<<<<<<<<<< + * with gil: + * callback = param + */ + +static void __pyx_f_4taos_8_objects_async_callback_wrapper(void *__pyx_v_param, TAOS_RES *__pyx_v_res, int __pyx_v_code) { + PyObject *__pyx_v_callback = NULL; + PyObject *__pyx_v_dt_epoch = NULL; + TAOS_FIELD *__pyx_v_fields; + int __pyx_v_field_count; + PyObject *__pyx_v_taos_fields = NULL; + PyObject *__pyx_v_block = NULL; + CYTHON_UNUSED PyObject *__pyx_v_num_of_rows = NULL; + int __pyx_v_errno; + PyObject *__pyx_v_row = NULL; + TAOS_FIELD __pyx_7genexpr__pyx_v_f; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + TAOS_FIELD *__pyx_t_5; + TAOS_FIELD *__pyx_t_6; + TAOS_FIELD *__pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save; + #endif + __Pyx_RefNannySetupContext("async_callback_wrapper", 1); + __Pyx_TraceCall("async_callback_wrapper", __pyx_f[0], 28, 1, __PYX_ERR(0, 28, __pyx_L1_error)); + + /* "taos/_objects.pyx":29 + * + * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: + * with gil: # <<<<<<<<<<<<<< + * callback = param + * print("callback:", callback, res, code) + */ + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { + + /* "taos/_objects.pyx":30 + * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: + * with gil: + * callback = param # <<<<<<<<<<<<<< + * print("callback:", callback, res, code) + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + */ + __pyx_t_1 = ((PyObject *)__pyx_v_param); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_callback = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":31 + * with gil: + * callback = param + * print("callback:", callback, res, code) # <<<<<<<<<<<<<< + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + * fields = taos_fetch_fields(res) + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_u_callback); + __Pyx_GIVEREF(__pyx_kp_u_callback); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_callback); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_callback); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":32 + * callback = param + * print("callback:", callback, res, code) + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch # <<<<<<<<<<<<<< + * fields = taos_fetch_fields(res) + * field_count = taos_field_count(res) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 32, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_v_dt_epoch = __pyx_t_2; + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":33 + * print("callback:", callback, res, code) + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + * fields = taos_fetch_fields(res) # <<<<<<<<<<<<<< + * field_count = taos_field_count(res) + * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] + */ + __pyx_v_fields = taos_fetch_fields(__pyx_v_res); + + /* "taos/_objects.pyx":34 + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + * fields = taos_fetch_fields(res) + * field_count = taos_field_count(res) # <<<<<<<<<<<<<< + * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] + * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) + */ + __pyx_v_field_count = taos_field_count(__pyx_v_res); + + /* "taos/_objects.pyx":35 + * fields = taos_fetch_fields(res) + * field_count = taos_field_count(res) + * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] # <<<<<<<<<<<<<< + * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) + * errno = taos_errno(res) + */ + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = (__pyx_v_fields + __pyx_v_field_count); + for (__pyx_t_7 = __pyx_v_fields; __pyx_t_7 < __pyx_t_6; __pyx_t_7++) { + __pyx_t_5 = __pyx_t_7; + __pyx_7genexpr__pyx_v_f = (__pyx_t_5[0]); + __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_7genexpr__pyx_v_f.name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode"); + __PYX_ERR(0, 35, __pyx_L4_error) + } + __pyx_t_1 = __Pyx_decode_bytes(((PyObject*)__pyx_t_3), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_int8_t(__pyx_7genexpr__pyx_v_f.type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_7genexpr__pyx_v_f.bytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 35, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4taos_8_objects_TaosField), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 35, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } /* exit inner scope */ + __pyx_v_taos_fields = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":36 + * field_count = taos_field_count(res) + * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] + * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) # <<<<<<<<<<<<<< + * errno = taos_errno(res) + * + */ + __pyx_t_2 = __pyx_f_4taos_11_cinterface_taos_fetch_block_v3(__pyx_v_res, __pyx_v_fields, __pyx_v_field_count, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 36, __pyx_L4_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_8 = PyList_GET_ITEM(sequence, 0); + __pyx_t_9 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + #else + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); + index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 2) < 0) __PYX_ERR(0, 36, __pyx_L4_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 36, __pyx_L4_error) + __pyx_L9_unpacking_done:; + } + __pyx_v_block = __pyx_t_8; + __pyx_t_8 = 0; + __pyx_v_num_of_rows = __pyx_t_9; + __pyx_t_9 = 0; + + /* "taos/_objects.pyx":37 + * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] + * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) + * errno = taos_errno(res) # <<<<<<<<<<<<<< + * + * if errno != 0: + */ + __pyx_v_errno = taos_errno(__pyx_v_res); + + /* "taos/_objects.pyx":39 + * errno = taos_errno(res) + * + * if errno != 0: # <<<<<<<<<<<<<< + * raise ProgrammingError(taos_errstr(res), errno) + * + */ + __pyx_t_4 = (__pyx_v_errno != 0); + if (unlikely(__pyx_t_4)) { + + /* "taos/_objects.pyx":40 + * + * if errno != 0: + * raise ProgrammingError(taos_errstr(res), errno) # <<<<<<<<<<<<<< + * + * for row in map(tuple, zip(*block)): + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 40, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyBytes_FromString(taos_errstr(__pyx_v_res)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 40, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_8, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 40, __pyx_L4_error) + + /* "taos/_objects.pyx":39 + * errno = taos_errno(res) + * + * if errno != 0: # <<<<<<<<<<<<<< + * raise ProgrammingError(taos_errstr(res), errno) + * + */ + } + + /* "taos/_objects.pyx":42 + * raise ProgrammingError(taos_errstr(res), errno) + * + * for row in map(tuple, zip(*block)): # <<<<<<<<<<<<<< + * callback(row, taos_fields) + * + */ + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_block); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF((PyObject *)(&PyTuple_Type)); + __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyTuple_Type))); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_2 = __pyx_t_9; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 42, __pyx_L4_error) + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 42, __pyx_L4_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 42, __pyx_L4_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } + } else { + __pyx_t_9 = __pyx_t_13(__pyx_t_2); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 42, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_9); + __pyx_t_9 = 0; + + /* "taos/_objects.pyx":43 + * + * for row in map(tuple, zip(*block)): + * callback(row, taos_fields) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_3 = __pyx_v_callback; __pyx_t_8 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_11 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_row, __pyx_v_taos_fields}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "taos/_objects.pyx":42 + * raise ProgrammingError(taos_errstr(res), errno) + * + * for row in map(tuple, zip(*block)): # <<<<<<<<<<<<<< + * callback(row, taos_fields) + * + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "taos/_objects.pyx":29 + * + * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: + * with gil: # <<<<<<<<<<<<<< + * callback = param + * print("callback:", callback, res, code) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L5; + } + __pyx_L4_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L1_error; + } + __pyx_L5:; + } + } + + /* "taos/_objects.pyx":28 + * + * + * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: # <<<<<<<<<<<<<< + * with gil: + * callback = param + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("taos._objects.async_callback_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __pyx_L0:; + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_XDECREF(__pyx_v_callback); + __Pyx_XDECREF(__pyx_v_dt_epoch); + __Pyx_XDECREF(__pyx_v_taos_fields); + __Pyx_XDECREF(__pyx_v_block); + __Pyx_XDECREF(__pyx_v_num_of_rows); + __Pyx_XDECREF(__pyx_v_row); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "taos/_objects.pyx":56 + * cdef TAOS *_raw_conn + * + * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): # <<<<<<<<<<<<<< + * if host: + * host = host.encode("utf-8") + */ + +/* Python wrapper */ +static int __pyx_pw_4taos_8_objects_14TaosConnection_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_4taos_8_objects_14TaosConnection_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_host = 0; + PyObject *__pyx_v_user = 0; + PyObject *__pyx_v_password = 0; + PyObject *__pyx_v_database = 0; + PyObject *__pyx_v_port = 0; + PyObject *__pyx_v_timezone = 0; + PyObject *__pyx_v_config = 0; + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_user,&__pyx_n_s_password,&__pyx_n_s_database,&__pyx_n_s_port,&__pyx_n_s_timezone,&__pyx_n_s_config,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)__pyx_n_u_root); + values[2] = ((PyObject *)__pyx_n_u_taosdata); + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); + values[5] = ((PyObject *)Py_None); + values[6] = ((PyObject *)Py_None); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 7: values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host); + if (value) { values[0] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_user); + if (value) { values[1] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_password); + if (value) { values[2] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_database); + if (value) { values[3] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_port); + if (value) { values[4] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timezone); + if (value) { values[5] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_config); + if (value) { values[6] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 7: values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_host = values[0]; + __pyx_v_user = values[1]; + __pyx_v_password = values[2]; + __pyx_v_database = values[3]; + __pyx_v_port = values[4]; + __pyx_v_timezone = values[5]; + __pyx_v_config = values[6]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 7, __pyx_nargs); __PYX_ERR(0, 56, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection___cinit__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_host, __pyx_v_user, __pyx_v_password, __pyx_v_database, __pyx_v_port, __pyx_v_timezone, __pyx_v_config); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_4taos_8_objects_14TaosConnection___cinit__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_user, PyObject *__pyx_v_password, PyObject *__pyx_v_database, PyObject *__pyx_v_port, PyObject *__pyx_v_timezone, PyObject *__pyx_v_config) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + char *__pyx_t_6; + uint16_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_TraceCall("__cinit__", __pyx_f[0], 56, 0, __PYX_ERR(0, 56, __pyx_L1_error)); + __Pyx_INCREF(__pyx_v_host); + __Pyx_INCREF(__pyx_v_user); + __Pyx_INCREF(__pyx_v_password); + __Pyx_INCREF(__pyx_v_database); + __Pyx_INCREF(__pyx_v_timezone); + __Pyx_INCREF(__pyx_v_config); + + /* "taos/_objects.pyx":57 + * + * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): + * if host: # <<<<<<<<<<<<<< + * host = host.encode("utf-8") + * self._host = host + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_host); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":58 + * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): + * if host: + * host = host.encode("utf-8") # <<<<<<<<<<<<<< + * self._host = host + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_host, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_host, __pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":59 + * if host: + * host = host.encode("utf-8") + * self._host = host # <<<<<<<<<<<<<< + * + * if user: + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_host); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_v_self->_host = __pyx_t_6; + + /* "taos/_objects.pyx":57 + * + * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): + * if host: # <<<<<<<<<<<<<< + * host = host.encode("utf-8") + * self._host = host + */ + } + + /* "taos/_objects.pyx":61 + * self._host = host + * + * if user: # <<<<<<<<<<<<<< + * user = user.encode("utf-8") + * self._user = user + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 61, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":62 + * + * if user: + * user = user.encode("utf-8") # <<<<<<<<<<<<<< + * self._user = user + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_user, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_user, __pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":63 + * if user: + * user = user.encode("utf-8") + * self._user = user # <<<<<<<<<<<<<< + * + * if password: + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_user); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_v_self->_user = __pyx_t_6; + + /* "taos/_objects.pyx":61 + * self._host = host + * + * if user: # <<<<<<<<<<<<<< + * user = user.encode("utf-8") + * self._user = user + */ + } + + /* "taos/_objects.pyx":65 + * self._user = user + * + * if password: # <<<<<<<<<<<<<< + * password = password.encode("utf-8") + * self._password = password + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_password); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":66 + * + * if password: + * password = password.encode("utf-8") # <<<<<<<<<<<<<< + * self._password = password + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_password, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_password, __pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":67 + * if password: + * password = password.encode("utf-8") + * self._password = password # <<<<<<<<<<<<<< + * + * if database: + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_password); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_v_self->_password = __pyx_t_6; + + /* "taos/_objects.pyx":65 + * self._user = user + * + * if password: # <<<<<<<<<<<<<< + * password = password.encode("utf-8") + * self._password = password + */ + } + + /* "taos/_objects.pyx":69 + * self._password = password + * + * if database: # <<<<<<<<<<<<<< + * database =database.encode("utf-8") + * self._database = database + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_database); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":70 + * + * if database: + * database =database.encode("utf-8") # <<<<<<<<<<<<<< + * self._database = database + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_database, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_database, __pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":71 + * if database: + * database =database.encode("utf-8") + * self._database = database # <<<<<<<<<<<<<< + * + * if port: + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_database); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_v_self->_database = __pyx_t_6; + + /* "taos/_objects.pyx":69 + * self._password = password + * + * if database: # <<<<<<<<<<<<<< + * database =database.encode("utf-8") + * self._database = database + */ + } + + /* "taos/_objects.pyx":73 + * self._database = database + * + * if port: # <<<<<<<<<<<<<< + * self._port = port + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_port); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 73, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":74 + * + * if port: + * self._port = port # <<<<<<<<<<<<<< + * + * if timezone: + */ + __pyx_t_7 = __Pyx_PyInt_As_uint16_t(__pyx_v_port); if (unlikely((__pyx_t_7 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_v_self->_port = __pyx_t_7; + + /* "taos/_objects.pyx":73 + * self._database = database + * + * if port: # <<<<<<<<<<<<<< + * self._port = port + * + */ + } + + /* "taos/_objects.pyx":76 + * self._port = port + * + * if timezone: # <<<<<<<<<<<<<< + * timezone = timezone.encode("utf-8") + * self._tz = timezone + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_timezone); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 76, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":77 + * + * if timezone: + * timezone = timezone.encode("utf-8") # <<<<<<<<<<<<<< + * self._tz = timezone + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timezone, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_timezone, __pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":78 + * if timezone: + * timezone = timezone.encode("utf-8") + * self._tz = timezone # <<<<<<<<<<<<<< + * + * if config: + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_timezone); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_v_self->_tz = __pyx_t_6; + + /* "taos/_objects.pyx":76 + * self._port = port + * + * if timezone: # <<<<<<<<<<<<<< + * timezone = timezone.encode("utf-8") + * self._tz = timezone + */ + } + + /* "taos/_objects.pyx":80 + * self._tz = timezone + * + * if config: # <<<<<<<<<<<<<< + * config = config.encode("utf-8") + * self._config = config + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_config); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 80, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":81 + * + * if config: + * config = config.encode("utf-8") # <<<<<<<<<<<<<< + * self._config = config + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_config, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_config, __pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":82 + * if config: + * config = config.encode("utf-8") + * self._config = config # <<<<<<<<<<<<<< + * + * self._init_options() + */ + __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_config); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_v_self->_config = __pyx_t_6; + + /* "taos/_objects.pyx":80 + * self._tz = timezone + * + * if config: # <<<<<<<<<<<<<< + * config = config.encode("utf-8") + * self._config = config + */ + } + + /* "taos/_objects.pyx":84 + * self._config = config + * + * self._init_options() # <<<<<<<<<<<<<< + * self._init_conn() + * self._check_conn_error() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_4, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":85 + * + * self._init_options() + * self._init_conn() # <<<<<<<<<<<<<< + * self._check_conn_error() + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_conn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_4, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":86 + * self._init_options() + * self._init_conn() + * self._check_conn_error() # <<<<<<<<<<<<<< + * + * def _init_options(self): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_conn_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_4, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":56 + * cdef TAOS *_raw_conn + * + * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): # <<<<<<<<<<<<<< + * if host: + * host = host.encode("utf-8") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("taos._objects.TaosConnection.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_host); + __Pyx_XDECREF(__pyx_v_user); + __Pyx_XDECREF(__pyx_v_password); + __Pyx_XDECREF(__pyx_v_database); + __Pyx_XDECREF(__pyx_v_timezone); + __Pyx_XDECREF(__pyx_v_config); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":88 + * self._check_conn_error() + * + * def _init_options(self): # <<<<<<<<<<<<<< + * if self._tz: + * tz = self._tz + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_3_init_options(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_2_init_options, "TaosConnection._init_options(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_3_init_options = {"_init_options", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_3_init_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_2_init_options}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_3_init_options(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init_options (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("_init_options", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_init_options", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_2_init_options(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_2_init_options(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + PyObject *__pyx_v_tz = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__2) + __Pyx_RefNannySetupContext("_init_options", 0); + __Pyx_TraceCall("_init_options", __pyx_f[0], 88, 0, __PYX_ERR(0, 88, __pyx_L1_error)); + + /* "taos/_objects.pyx":89 + * + * def _init_options(self): + * if self._tz: # <<<<<<<<<<<<<< + * tz = self._tz + * set_tz(pytz.timezone(tz.decode("utf-8"))) + */ + __pyx_t_1 = (__pyx_v_self->_tz != 0); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":90 + * def _init_options(self): + * if self._tz: + * tz = self._tz # <<<<<<<<<<<<<< + * set_tz(pytz.timezone(tz.decode("utf-8"))) + * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) + */ + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_tz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tz = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "taos/_objects.pyx":91 + * if self._tz: + * tz = self._tz + * set_tz(pytz.timezone(tz.decode("utf-8"))) # <<<<<<<<<<<<<< + * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_tz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pytz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_timezone); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__pyx_v_tz == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode"); + __PYX_ERR(0, 91, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_decode_bytes(__pyx_v_tz, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":92 + * tz = self._tz + * set_tz(pytz.timezone(tz.decode("utf-8"))) + * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) # <<<<<<<<<<<<<< + * + * if self._config: + */ + (void)(taos_options(TSDB_OPTION_TIMEZONE, __pyx_v_self->_tz)); + + /* "taos/_objects.pyx":89 + * + * def _init_options(self): + * if self._tz: # <<<<<<<<<<<<<< + * tz = self._tz + * set_tz(pytz.timezone(tz.decode("utf-8"))) + */ + } + + /* "taos/_objects.pyx":94 + * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) + * + * if self._config: # <<<<<<<<<<<<<< + * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + * + */ + __pyx_t_1 = (__pyx_v_self->_config != 0); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":95 + * + * if self._config: + * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) # <<<<<<<<<<<<<< + * + * def _init_conn(self): + */ + (void)(taos_options(TSDB_OPTION_CONFIGDIR, __pyx_v_self->_config)); + + /* "taos/_objects.pyx":94 + * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) + * + * if self._config: # <<<<<<<<<<<<<< + * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + * + */ + } + + /* "taos/_objects.pyx":88 + * self._check_conn_error() + * + * def _init_options(self): # <<<<<<<<<<<<<< + * if self._tz: + * tz = self._tz + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("taos._objects.TaosConnection._init_options", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tz); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":97 + * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + * + * def _init_conn(self): # <<<<<<<<<<<<<< + * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_5_init_conn(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_4_init_conn, "TaosConnection._init_conn(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_5_init_conn = {"_init_conn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_5_init_conn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_4_init_conn}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_5_init_conn(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init_conn (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("_init_conn", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_init_conn", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_4_init_conn(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_4_init_conn(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__3) + __Pyx_RefNannySetupContext("_init_conn", 0); + __Pyx_TraceCall("_init_conn", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error)); + + /* "taos/_objects.pyx":98 + * + * def _init_conn(self): + * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) # <<<<<<<<<<<<<< + * + * def _check_conn_error(self): + */ + __pyx_v_self->_raw_conn = taos_connect(__pyx_v_self->_host, __pyx_v_self->_user, __pyx_v_self->_password, __pyx_v_self->_database, __pyx_v_self->_port); + + /* "taos/_objects.pyx":97 + * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + * + * def _init_conn(self): # <<<<<<<<<<<<<< + * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection._init_conn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":100 + * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + * + * def _check_conn_error(self): # <<<<<<<<<<<<<< + * errno = taos_errno(self._raw_conn) + * if errno != 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_7_check_conn_error(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_6_check_conn_error, "TaosConnection._check_conn_error(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_7_check_conn_error = {"_check_conn_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_7_check_conn_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_6_check_conn_error}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_7_check_conn_error(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_conn_error (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("_check_conn_error", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_check_conn_error", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_6_check_conn_error(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_6_check_conn_error(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + int __pyx_v_errno; + char *__pyx_v_errstr; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__4) + __Pyx_RefNannySetupContext("_check_conn_error", 0); + __Pyx_TraceCall("_check_conn_error", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error)); + + /* "taos/_objects.pyx":101 + * + * def _check_conn_error(self): + * errno = taos_errno(self._raw_conn) # <<<<<<<<<<<<<< + * if errno != 0: + * errstr = taos_errstr(self._raw_conn) + */ + __pyx_v_errno = taos_errno(__pyx_v_self->_raw_conn); + + /* "taos/_objects.pyx":102 + * def _check_conn_error(self): + * errno = taos_errno(self._raw_conn) + * if errno != 0: # <<<<<<<<<<<<<< + * errstr = taos_errstr(self._raw_conn) + * raise ConnectionError(errstr, errno) + */ + __pyx_t_1 = (__pyx_v_errno != 0); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":103 + * errno = taos_errno(self._raw_conn) + * if errno != 0: + * errstr = taos_errstr(self._raw_conn) # <<<<<<<<<<<<<< + * raise ConnectionError(errstr, errno) + * + */ + __pyx_v_errstr = taos_errstr(__pyx_v_self->_raw_conn); + + /* "taos/_objects.pyx":104 + * if errno != 0: + * errstr = taos_errstr(self._raw_conn) + * raise ConnectionError(errstr, errno) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_errstr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 104, __pyx_L1_error) + + /* "taos/_objects.pyx":102 + * def _check_conn_error(self): + * errno = taos_errno(self._raw_conn) + * if errno != 0: # <<<<<<<<<<<<<< + * errstr = taos_errstr(self._raw_conn) + * raise ConnectionError(errstr, errno) + */ + } + + /* "taos/_objects.pyx":100 + * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + * + * def _check_conn_error(self): # <<<<<<<<<<<<<< + * errno = taos_errno(self._raw_conn) + * if errno != 0: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("taos._objects.TaosConnection._check_conn_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":106 + * raise ConnectionError(errstr, errno) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * self.close() + * + */ + +/* Python wrapper */ +static void __pyx_pw_4taos_8_objects_14TaosConnection_9__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_4taos_8_objects_14TaosConnection_9__dealloc__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_4taos_8_objects_14TaosConnection_8__dealloc__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_4taos_8_objects_14TaosConnection_8__dealloc__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__dealloc__", 0); + __Pyx_TraceCall("__dealloc__", __pyx_f[0], 106, 0, __PYX_ERR(0, 106, __pyx_L1_error)); + + /* "taos/_objects.pyx":107 + * + * def __dealloc__(self): + * self.close() # <<<<<<<<<<<<<< + * + * def close(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_objects.pyx":106 + * raise ConnectionError(errstr, errno) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * self.close() + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("taos._objects.TaosConnection.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "taos/_objects.pyx":109 + * self.close() + * + * def close(self): # <<<<<<<<<<<<<< + * if self._raw_conn is not NULL: + * taos_close(self._raw_conn) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11close(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_10close, "TaosConnection.close(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_11close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_11close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_10close}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11close(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_10close(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_10close(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__5) + __Pyx_RefNannySetupContext("close", 0); + __Pyx_TraceCall("close", __pyx_f[0], 109, 0, __PYX_ERR(0, 109, __pyx_L1_error)); + + /* "taos/_objects.pyx":110 + * + * def close(self): + * if self._raw_conn is not NULL: # <<<<<<<<<<<<<< + * taos_close(self._raw_conn) + * self._raw_conn = NULL + */ + __pyx_t_1 = (__pyx_v_self->_raw_conn != NULL); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":111 + * def close(self): + * if self._raw_conn is not NULL: + * taos_close(self._raw_conn) # <<<<<<<<<<<<<< + * self._raw_conn = NULL + * + */ + taos_close(__pyx_v_self->_raw_conn); + + /* "taos/_objects.pyx":112 + * if self._raw_conn is not NULL: + * taos_close(self._raw_conn) + * self._raw_conn = NULL # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_v_self->_raw_conn = NULL; + + /* "taos/_objects.pyx":110 + * + * def close(self): + * if self._raw_conn is not NULL: # <<<<<<<<<<<<<< + * taos_close(self._raw_conn) + * self._raw_conn = NULL + */ + } + + /* "taos/_objects.pyx":109 + * self.close() + * + * def close(self): # <<<<<<<<<<<<<< + * if self._raw_conn is not NULL: + * taos_close(self._raw_conn) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.close", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":114 + * self._raw_conn = NULL + * + * @property # <<<<<<<<<<<<<< + * def client_info(self): + * return taos_get_client_info().decode("utf-8") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11client_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11client_info_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_11client_info___get__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_11client_info___get__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + char const *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 114, 0, __PYX_ERR(0, 114, __pyx_L1_error)); + + /* "taos/_objects.pyx":116 + * @property + * def client_info(self): + * return taos_get_client_info().decode("utf-8") # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = taos_get_client_info(); + __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":114 + * self._raw_conn = NULL + * + * @property # <<<<<<<<<<<<<< + * def client_info(self): + * return taos_get_client_info().decode("utf-8") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("taos._objects.TaosConnection.client_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":118 + * return taos_get_client_info().decode("utf-8") + * + * @property # <<<<<<<<<<<<<< + * def server_info(self): + * # type: () -> str + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11server_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11server_info_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_11server_info___get__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_11server_info___get__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + char const *__pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 118, 0, __PYX_ERR(0, 118, __pyx_L1_error)); + + /* "taos/_objects.pyx":121 + * def server_info(self): + * # type: () -> str + * if self._raw_conn is NULL: # <<<<<<<<<<<<<< + * return + * return taos_get_server_info(self._raw_conn).decode("utf-8") + */ + __pyx_t_1 = (__pyx_v_self->_raw_conn == NULL); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":122 + * # type: () -> str + * if self._raw_conn is NULL: + * return # <<<<<<<<<<<<<< + * return taos_get_server_info(self._raw_conn).decode("utf-8") + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "taos/_objects.pyx":121 + * def server_info(self): + * # type: () -> str + * if self._raw_conn is NULL: # <<<<<<<<<<<<<< + * return + * return taos_get_server_info(self._raw_conn).decode("utf-8") + */ + } + + /* "taos/_objects.pyx":123 + * if self._raw_conn is NULL: + * return + * return taos_get_server_info(self._raw_conn).decode("utf-8") # <<<<<<<<<<<<<< + * + * def select_db(self, database: str): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = taos_get_server_info(__pyx_v_self->_raw_conn); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":118 + * return taos_get_client_info().decode("utf-8") + * + * @property # <<<<<<<<<<<<<< + * def server_info(self): + * # type: () -> str + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("taos._objects.TaosConnection.server_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":125 + * return taos_get_server_info(self._raw_conn).decode("utf-8") + * + * def select_db(self, database: str): # <<<<<<<<<<<<<< + * _database = database.encode("utf-8") + * res = taos_select_db(self._raw_conn, _database) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_13select_db(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_12select_db, "TaosConnection.select_db(self, unicode database: str)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_13select_db = {"select_db", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_13select_db, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_12select_db}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_13select_db(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_database = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("select_db (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_database,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_database)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "select_db") < 0)) __PYX_ERR(0, 125, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_database = ((PyObject*)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("select_db", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 125, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.select_db", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_database), (&PyUnicode_Type), 0, "database", 1))) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_12select_db(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_database); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_12select_db(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_database) { + PyObject *__pyx_v__database = NULL; + int __pyx_v_res; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__6) + __Pyx_RefNannySetupContext("select_db", 0); + __Pyx_TraceCall("select_db", __pyx_f[0], 125, 0, __PYX_ERR(0, 125, __pyx_L1_error)); + + /* "taos/_objects.pyx":126 + * + * def select_db(self, database: str): + * _database = database.encode("utf-8") # <<<<<<<<<<<<<< + * res = taos_select_db(self._raw_conn, _database) + * if res != 0: + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__database = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":127 + * def select_db(self, database: str): + * _database = database.encode("utf-8") + * res = taos_select_db(self._raw_conn, _database) # <<<<<<<<<<<<<< + * if res != 0: + * raise DatabaseError("select database error", res) + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__database); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_v_res = taos_select_db(__pyx_v_self->_raw_conn, __pyx_t_2); + + /* "taos/_objects.pyx":128 + * _database = database.encode("utf-8") + * res = taos_select_db(self._raw_conn, _database) + * if res != 0: # <<<<<<<<<<<<<< + * raise DatabaseError("select database error", res) + * + */ + __pyx_t_3 = (__pyx_v_res != 0); + if (unlikely(__pyx_t_3)) { + + /* "taos/_objects.pyx":129 + * res = taos_select_db(self._raw_conn, _database) + * if res != 0: + * raise DatabaseError("select database error", res) # <<<<<<<<<<<<<< + * + * def execute(self, sql: str, req_id: Optional[int] = None): + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_kp_u_select_database_error, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 129, __pyx_L1_error) + + /* "taos/_objects.pyx":128 + * _database = database.encode("utf-8") + * res = taos_select_db(self._raw_conn, _database) + * if res != 0: # <<<<<<<<<<<<<< + * raise DatabaseError("select database error", res) + * + */ + } + + /* "taos/_objects.pyx":125 + * return taos_get_server_info(self._raw_conn).decode("utf-8") + * + * def select_db(self, database: str): # <<<<<<<<<<<<<< + * _database = database.encode("utf-8") + * res = taos_select_db(self._raw_conn, _database) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("taos._objects.TaosConnection.select_db", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__database); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":131 + * raise DatabaseError("select database error", res) + * + * def execute(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * return self.query(sql, req_id).affected_rows + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_15execute(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_14execute, "TaosConnection.execute(self, unicode sql: str, int req_id: Optional[int] = None)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_15execute = {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_15execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_14execute}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_15execute(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_sql = 0; + PyObject *__pyx_v_req_id = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sql,&__pyx_n_s_req_id,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject*)Py_None); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sql)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_req_id); + if (value) { values[1] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "execute") < 0)) __PYX_ERR(0, 131, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_sql = ((PyObject*)values[0]); + __pyx_v_req_id = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("execute", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 131, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sql), (&PyUnicode_Type), 0, "sql", 1))) __PYX_ERR(0, 131, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_req_id), (&PyInt_Type), 1, "req_id", 1))) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_14execute(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_sql, __pyx_v_req_id); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_14execute(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_req_id) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__7) + __Pyx_RefNannySetupContext("execute", 0); + __Pyx_TraceCall("execute", __pyx_f[0], 131, 0, __PYX_ERR(0, 131, __pyx_L1_error)); + + /* "taos/_objects.pyx":132 + * + * def execute(self, sql: str, req_id: Optional[int] = None): + * return self.query(sql, req_id).affected_rows # <<<<<<<<<<<<<< + * + * def query(self, sql: str, req_id: Optional[int] = None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_sql, __pyx_v_req_id}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_affected_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":131 + * raise DatabaseError("select database error", res) + * + * def execute(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * return self.query(sql, req_id).affected_rows + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("taos._objects.TaosConnection.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":134 + * return self.query(sql, req_id).affected_rows + * + * def query(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * _sql = sql.encode("utf-8") + * if req_id is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_17query(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_16query, "TaosConnection.query(self, unicode sql: str, int req_id: Optional[int] = None)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_17query = {"query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_17query, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_16query}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_17query(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_sql = 0; + PyObject *__pyx_v_req_id = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("query (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sql,&__pyx_n_s_req_id,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject*)Py_None); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sql)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_req_id); + if (value) { values[1] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "query") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_sql = ((PyObject*)values[0]); + __pyx_v_req_id = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("query", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.query", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sql), (&PyUnicode_Type), 0, "sql", 1))) __PYX_ERR(0, 134, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_req_id), (&PyInt_Type), 1, "req_id", 1))) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_16query(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_sql, __pyx_v_req_id); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_16query(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_req_id) { + PyObject *__pyx_v__sql = NULL; + TAOS_RES *__pyx_v_res; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + char const *__pyx_t_3; + char const *__pyx_t_4; + int64_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__8) + __Pyx_RefNannySetupContext("query", 0); + __Pyx_TraceCall("query", __pyx_f[0], 134, 0, __PYX_ERR(0, 134, __pyx_L1_error)); + + /* "taos/_objects.pyx":135 + * + * def query(self, sql: str, req_id: Optional[int] = None): + * _sql = sql.encode("utf-8") # <<<<<<<<<<<<<< + * if req_id is None: + * res = taos_query(self._raw_conn, _sql) + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__sql = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":136 + * def query(self, sql: str, req_id: Optional[int] = None): + * _sql = sql.encode("utf-8") + * if req_id is None: # <<<<<<<<<<<<<< + * res = taos_query(self._raw_conn, _sql) + * else: + */ + __pyx_t_2 = (__pyx_v_req_id == ((PyObject*)Py_None)); + if (__pyx_t_2) { + + /* "taos/_objects.pyx":137 + * _sql = sql.encode("utf-8") + * if req_id is None: + * res = taos_query(self._raw_conn, _sql) # <<<<<<<<<<<<<< + * else: + * res = taos_query_with_reqid(self._raw_conn, _sql, req_id) + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v__sql); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_v_res = taos_query(__pyx_v_self->_raw_conn, __pyx_t_3); + + /* "taos/_objects.pyx":136 + * def query(self, sql: str, req_id: Optional[int] = None): + * _sql = sql.encode("utf-8") + * if req_id is None: # <<<<<<<<<<<<<< + * res = taos_query(self._raw_conn, _sql) + * else: + */ + goto __pyx_L3; + } + + /* "taos/_objects.pyx":139 + * res = taos_query(self._raw_conn, _sql) + * else: + * res = taos_query_with_reqid(self._raw_conn, _sql, req_id) # <<<<<<<<<<<<<< + * + * return TaosResult(res) + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v__sql); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_req_id); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_v_res = taos_query_with_reqid(__pyx_v_self->_raw_conn, __pyx_t_4, __pyx_t_5); + } + __pyx_L3:; + + /* "taos/_objects.pyx":141 + * res = taos_query_with_reqid(self._raw_conn, _sql, req_id) + * + * return TaosResult(res) # <<<<<<<<<<<<<< + * + * def query_a(self, sql: str, callback, req_id: Optional[int] = None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":134 + * return self.query(sql, req_id).affected_rows + * + * def query(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * _sql = sql.encode("utf-8") + * if req_id is None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("taos._objects.TaosConnection.query", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__sql); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":143 + * return TaosResult(res) + * + * def query_a(self, sql: str, callback, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * _sql = sql.encode("utf-8") + * if req_id is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_19query_a(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_18query_a, "TaosConnection.query_a(self, unicode sql: str, callback, int req_id: Optional[int] = None)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_19query_a = {"query_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_19query_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_18query_a}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_19query_a(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_sql = 0; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_req_id = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("query_a (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sql,&__pyx_n_s_callback_2,&__pyx_n_s_req_id,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject*)Py_None); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sql)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback_2)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("query_a", 0, 2, 3, 1); __PYX_ERR(0, 143, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_req_id); + if (value) { values[2] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "query_a") < 0)) __PYX_ERR(0, 143, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_sql = ((PyObject*)values[0]); + __pyx_v_callback = values[1]; + __pyx_v_req_id = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("query_a", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 143, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.query_a", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sql), (&PyUnicode_Type), 0, "sql", 1))) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_req_id), (&PyInt_Type), 1, "req_id", 1))) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_18query_a(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_sql, __pyx_v_callback, __pyx_v_req_id); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_18query_a(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_callback, PyObject *__pyx_v_req_id) { + PyObject *__pyx_v__sql = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + char const *__pyx_t_3; + char const *__pyx_t_4; + int64_t __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__9) + __Pyx_RefNannySetupContext("query_a", 0); + __Pyx_TraceCall("query_a", __pyx_f[0], 143, 0, __PYX_ERR(0, 143, __pyx_L1_error)); + + /* "taos/_objects.pyx":144 + * + * def query_a(self, sql: str, callback, req_id: Optional[int] = None): + * _sql = sql.encode("utf-8") # <<<<<<<<<<<<<< + * if req_id is None: + * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__sql = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":145 + * def query_a(self, sql: str, callback, req_id: Optional[int] = None): + * _sql = sql.encode("utf-8") + * if req_id is None: # <<<<<<<<<<<<<< + * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) + * else: + */ + __pyx_t_2 = (__pyx_v_req_id == ((PyObject*)Py_None)); + if (__pyx_t_2) { + + /* "taos/_objects.pyx":146 + * _sql = sql.encode("utf-8") + * if req_id is None: + * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) # <<<<<<<<<<<<<< + * else: + * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v__sql); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) + taos_query_a(__pyx_v_self->_raw_conn, __pyx_t_3, __pyx_f_4taos_8_objects_async_callback_wrapper, ((void *)__pyx_v_callback)); + + /* "taos/_objects.pyx":145 + * def query_a(self, sql: str, callback, req_id: Optional[int] = None): + * _sql = sql.encode("utf-8") + * if req_id is None: # <<<<<<<<<<<<<< + * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) + * else: + */ + goto __pyx_L3; + } + + /* "taos/_objects.pyx":148 + * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) + * else: + * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) # <<<<<<<<<<<<<< + * + * def subscribe(self, configs: dict[str, str], callback): + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v__sql); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_req_id); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error) + taos_query_a_with_reqid(__pyx_v_self->_raw_conn, __pyx_t_4, __pyx_f_4taos_8_objects_async_callback_wrapper, ((void *)__pyx_v_callback), __pyx_t_5); + } + __pyx_L3:; + + /* "taos/_objects.pyx":143 + * return TaosResult(res) + * + * def query_a(self, sql: str, callback, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * _sql = sql.encode("utf-8") + * if req_id is None: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosConnection.query_a", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__sql); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":150 + * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + * + * def subscribe(self, configs: dict[str, str], callback): # <<<<<<<<<<<<<< + * if self._raw_conn is NULL: + * return None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_21subscribe(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_20subscribe, "TaosConnection.subscribe(self, dict configs: dict[str, str], callback)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_21subscribe = {"subscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_21subscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_20subscribe}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_21subscribe(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_configs = 0; + CYTHON_UNUSED PyObject *__pyx_v_callback = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("subscribe (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_configs,&__pyx_n_s_callback_2,0}; + PyObject* values[2] = {0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_configs)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback_2)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("subscribe", 1, 2, 2, 1); __PYX_ERR(0, 150, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "subscribe") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_configs = ((PyObject*)values[0]); + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("subscribe", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 150, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.subscribe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_configs), (&PyDict_Type), 0, "configs", 1))) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_20subscribe(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_configs, __pyx_v_callback); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_20subscribe(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_configs, CYTHON_UNUSED PyObject *__pyx_v_callback) { + tmq_conf_t *__pyx_v_tmq_conf; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v__k = NULL; + PyObject *__pyx_v__v = NULL; + tmq_conf_res_t __pyx_v_tmq_conf_res; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + char const *__pyx_t_10; + char const *__pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__10) + __Pyx_RefNannySetupContext("subscribe", 0); + __Pyx_TraceCall("subscribe", __pyx_f[0], 150, 0, __PYX_ERR(0, 150, __pyx_L1_error)); + + /* "taos/_objects.pyx":151 + * + * def subscribe(self, configs: dict[str, str], callback): + * if self._raw_conn is NULL: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_1 = (__pyx_v_self->_raw_conn == NULL); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":152 + * def subscribe(self, configs: dict[str, str], callback): + * if self._raw_conn is NULL: + * return None # <<<<<<<<<<<<<< + * + * tmq_conf = tmq_conf_new() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "taos/_objects.pyx":151 + * + * def subscribe(self, configs: dict[str, str], callback): + * if self._raw_conn is NULL: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "taos/_objects.pyx":154 + * return None + * + * tmq_conf = tmq_conf_new() # <<<<<<<<<<<<<< + * for k, v in configs.items(): + * _k = k.encode("utf-8") + */ + __pyx_v_tmq_conf = tmq_conf_new(); + + /* "taos/_objects.pyx":155 + * + * tmq_conf = tmq_conf_new() + * for k, v in configs.items(): # <<<<<<<<<<<<<< + * _k = k.encode("utf-8") + * _v = v.encode("utf-8") + */ + __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_configs, 1, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_6; + __pyx_t_6 = 0; + while (1) { + __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, &__pyx_t_7, NULL, __pyx_t_5); + if (unlikely(__pyx_t_8 == 0)) break; + if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + __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; + + /* "taos/_objects.pyx":156 + * tmq_conf = tmq_conf_new() + * for k, v in configs.items(): + * _k = k.encode("utf-8") # <<<<<<<<<<<<<< + * _v = v.encode("utf-8") + * tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_utf_8}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF_SET(__pyx_v__k, __pyx_t_7); + __pyx_t_7 = 0; + + /* "taos/_objects.pyx":157 + * for k, v in configs.items(): + * _k = k.encode("utf-8") + * _v = v.encode("utf-8") # <<<<<<<<<<<<<< + * tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) + * print("tmq_conf_res:", tmq_conf_res) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_utf_8}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF_SET(__pyx_v__v, __pyx_t_7); + __pyx_t_7 = 0; + + /* "taos/_objects.pyx":158 + * _k = k.encode("utf-8") + * _v = v.encode("utf-8") + * tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) # <<<<<<<<<<<<<< + * print("tmq_conf_res:", tmq_conf_res) + * + */ + __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v__k); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v__v); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_v_tmq_conf_res = tmq_conf_set(__pyx_v_tmq_conf, __pyx_t_10, __pyx_t_11); + + /* "taos/_objects.pyx":159 + * _v = v.encode("utf-8") + * tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) + * print("tmq_conf_res:", tmq_conf_res) # <<<<<<<<<<<<<< + * + * def load_table_info(self, tables: list): + */ + __pyx_t_7 = __Pyx_PyInt_From_int(((int)__pyx_v_tmq_conf_res)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_kp_u_tmq_conf_res); + __Pyx_GIVEREF(__pyx_kp_u_tmq_conf_res); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_tmq_conf_res); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":150 + * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + * + * def subscribe(self, configs: dict[str, str], callback): # <<<<<<<<<<<<<< + * if self._raw_conn is NULL: + * return None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("taos._objects.TaosConnection.subscribe", __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__k); + __Pyx_XDECREF(__pyx_v__v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":161 + * print("tmq_conf_res:", tmq_conf_res) + * + * def load_table_info(self, tables: list): # <<<<<<<<<<<<<< + * # type: (str) -> None + * _tables = ",".join(tables).encode("utf-8") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_23load_table_info(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_22load_table_info, "TaosConnection.load_table_info(self, list tables: list)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_23load_table_info = {"load_table_info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_23load_table_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_22load_table_info}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_23load_table_info(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_tables = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("load_table_info (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tables,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tables)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load_table_info") < 0)) __PYX_ERR(0, 161, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_tables = ((PyObject*)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("load_table_info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 161, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.load_table_info", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tables), (&PyList_Type), 0, "tables", 1))) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_22load_table_info(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_tables); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_22load_table_info(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_tables) { + PyObject *__pyx_v__tables = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + char const *__pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__11) + __Pyx_RefNannySetupContext("load_table_info", 0); + __Pyx_TraceCall("load_table_info", __pyx_f[0], 161, 0, __PYX_ERR(0, 161, __pyx_L1_error)); + + /* "taos/_objects.pyx":163 + * def load_table_info(self, tables: list): + * # type: (str) -> None + * _tables = ",".join(tables).encode("utf-8") # <<<<<<<<<<<<<< + * taos_load_table_info(self._raw_conn, _tables) + * + */ + __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__12, __pyx_v_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v__tables = __pyx_t_2; + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":164 + * # type: (str) -> None + * _tables = ",".join(tables).encode("utf-8") + * taos_load_table_info(self._raw_conn, _tables) # <<<<<<<<<<<<<< + * + * def commit(self): + */ + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v__tables); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error) + (void)(taos_load_table_info(__pyx_v_self->_raw_conn, __pyx_t_3)); + + /* "taos/_objects.pyx":161 + * print("tmq_conf_res:", tmq_conf_res) + * + * def load_table_info(self, tables: list): # <<<<<<<<<<<<<< + * # type: (str) -> None + * _tables = ",".join(tables).encode("utf-8") + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("taos._objects.TaosConnection.load_table_info", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__tables); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":166 + * taos_load_table_info(self._raw_conn, _tables) + * + * def commit(self): # <<<<<<<<<<<<<< + * """Commit any pending transaction to the database. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_25commit(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_24commit, "TaosConnection.commit(self)\nCommit any pending transaction to the database.\n\n Since TDengine do not support transactions, the implement is void functionality.\n "); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_25commit = {"commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_25commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_24commit}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_25commit(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("commit (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("commit", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "commit", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_24commit(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_24commit(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__13) + __Pyx_RefNannySetupContext("commit", 0); + __Pyx_TraceCall("commit", __pyx_f[0], 166, 0, __PYX_ERR(0, 166, __pyx_L1_error)); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.commit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":173 + * pass + * + * def rollback(self): # <<<<<<<<<<<<<< + * """Void functionality""" + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_27rollback(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_26rollback, "TaosConnection.rollback(self)\nVoid functionality"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_27rollback = {"rollback", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_27rollback, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_26rollback}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_27rollback(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rollback (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("rollback", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rollback", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_26rollback(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_26rollback(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__14) + __Pyx_RefNannySetupContext("rollback", 0); + __Pyx_TraceCall("rollback", __pyx_f[0], 173, 0, __PYX_ERR(0, 173, __pyx_L1_error)); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.rollback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":177 + * pass + * + * def clear_result_set(self): # <<<<<<<<<<<<<< + * """Clear unused result set on this connection.""" + * pass + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_29clear_result_set(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_28clear_result_set, "TaosConnection.clear_result_set(self)\nClear unused result set on this connection."); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_29clear_result_set = {"clear_result_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_29clear_result_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_28clear_result_set}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_29clear_result_set(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear_result_set (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("clear_result_set", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear_result_set", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_28clear_result_set(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_28clear_result_set(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__15) + __Pyx_RefNannySetupContext("clear_result_set", 0); + __Pyx_TraceCall("clear_result_set", __pyx_f[0], 177, 0, __PYX_ERR(0, 177, __pyx_L1_error)); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.clear_result_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":181 + * pass + * + * def get_table_vgroup_id(self, db: str, table: str): # <<<<<<<<<<<<<< + * # type: (str, str) -> int + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_31get_table_vgroup_id(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_30get_table_vgroup_id, "TaosConnection.get_table_vgroup_id(self, unicode db: str, unicode table: str)\n\n get table's vgroup id. It's require db name and table name, and return an int type vgroup id.\n "); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_31get_table_vgroup_id = {"get_table_vgroup_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_31get_table_vgroup_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_30get_table_vgroup_id}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_31get_table_vgroup_id(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_db = 0; + PyObject *__pyx_v_table = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_table_vgroup_id (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_db,&__pyx_n_s_table,0}; + PyObject* values[2] = {0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_db)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_table)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("get_table_vgroup_id", 1, 2, 2, 1); __PYX_ERR(0, 181, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_table_vgroup_id") < 0)) __PYX_ERR(0, 181, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_db = ((PyObject*)values[0]); + __pyx_v_table = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_table_vgroup_id", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 181, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.get_table_vgroup_id", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_db), (&PyUnicode_Type), 0, "db", 1))) __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyUnicode_Type), 0, "table", 1))) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_30get_table_vgroup_id(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_db, __pyx_v_table); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_30get_table_vgroup_id(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_db, PyObject *__pyx_v_table) { + int __pyx_v_vg_id; + PyObject *__pyx_v__db = NULL; + PyObject *__pyx_v__table = NULL; + int __pyx_v_code; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + char const *__pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__16) + __Pyx_RefNannySetupContext("get_table_vgroup_id", 0); + __Pyx_TraceCall("get_table_vgroup_id", __pyx_f[0], 181, 0, __PYX_ERR(0, 181, __pyx_L1_error)); + + /* "taos/_objects.pyx":187 + * """ + * cdef int vg_id + * _db = db.encode("utf-8") # <<<<<<<<<<<<<< + * _table = table.encode("utf-8") + * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_db); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__db = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":188 + * cdef int vg_id + * _db = db.encode("utf-8") + * _table = table.encode("utf-8") # <<<<<<<<<<<<<< + * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) + * if code != 0: + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__table = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":189 + * _db = db.encode("utf-8") + * _table = table.encode("utf-8") + * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) # <<<<<<<<<<<<<< + * if code != 0: + * raise InternalError(taos_errstr(NULL)) + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__db); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v__table); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_v_code = taos_get_table_vgId(__pyx_v_self->_raw_conn, __pyx_t_2, __pyx_t_3, (&__pyx_v_vg_id)); + + /* "taos/_objects.pyx":190 + * _table = table.encode("utf-8") + * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) + * if code != 0: # <<<<<<<<<<<<<< + * raise InternalError(taos_errstr(NULL)) + * return vg_id + */ + __pyx_t_4 = (__pyx_v_code != 0); + if (unlikely(__pyx_t_4)) { + + /* "taos/_objects.pyx":191 + * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) + * if code != 0: + * raise InternalError(taos_errstr(NULL)) # <<<<<<<<<<<<<< + * return vg_id + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_InternalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(taos_errstr(NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 191, __pyx_L1_error) + + /* "taos/_objects.pyx":190 + * _table = table.encode("utf-8") + * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) + * if code != 0: # <<<<<<<<<<<<<< + * raise InternalError(taos_errstr(NULL)) + * return vg_id + */ + } + + /* "taos/_objects.pyx":192 + * if code != 0: + * raise InternalError(taos_errstr(NULL)) + * return vg_id # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_vg_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":181 + * pass + * + * def get_table_vgroup_id(self, db: str, table: str): # <<<<<<<<<<<<<< + * # type: (str, str) -> int + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("taos._objects.TaosConnection.get_table_vgroup_id", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__db); + __Pyx_XDECREF(__pyx_v__table); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_33__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_32__reduce_cython__, "TaosConnection.__reduce_cython__(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_32__reduce_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_33__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_32__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__17) + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_35__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_34__setstate_cython__, "TaosConnection.__setstate_cython__(self, __pyx_state)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_34__setstate_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_35__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v___pyx_state = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_34__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__18) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); + + /* "(tree fragment)":4 + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosConnection.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":200 + * cdef int32_t _bytes + * + * def __cinit__(self, str name, int8_t type_, int32_t bytes): # <<<<<<<<<<<<<< + * self._name = name + * self._type = type_ + */ + +/* Python wrapper */ +static int __pyx_pw_4taos_8_objects_9TaosField_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_4taos_8_objects_9TaosField_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int8_t __pyx_v_type_; + int32_t __pyx_v_bytes; + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_type,&__pyx_n_s_bytes,0}; + PyObject* values[3] = {0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 200, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bytes)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 200, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 200, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); + values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); + } + __pyx_v_name = ((PyObject*)values[0]); + __pyx_v_type_ = __Pyx_PyInt_As_int8_t(values[1]); if (unlikely((__pyx_v_type_ == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) + __pyx_v_bytes = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_bytes == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 200, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosField.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField___cinit__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self), __pyx_v_name, __pyx_v_type_, __pyx_v_bytes); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_4taos_8_objects_9TaosField___cinit__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, PyObject *__pyx_v_name, int8_t __pyx_v_type_, int32_t __pyx_v_bytes) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_TraceCall("__cinit__", __pyx_f[0], 200, 0, __PYX_ERR(0, 200, __pyx_L1_error)); + + /* "taos/_objects.pyx":201 + * + * def __cinit__(self, str name, int8_t type_, int32_t bytes): + * self._name = name # <<<<<<<<<<<<<< + * self._type = type_ + * self._bytes = bytes + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->_name); + __Pyx_DECREF(__pyx_v_self->_name); + __pyx_v_self->_name = __pyx_v_name; + + /* "taos/_objects.pyx":202 + * def __cinit__(self, str name, int8_t type_, int32_t bytes): + * self._name = name + * self._type = type_ # <<<<<<<<<<<<<< + * self._bytes = bytes + * + */ + __pyx_v_self->_type = __pyx_v_type_; + + /* "taos/_objects.pyx":203 + * self._name = name + * self._type = type_ + * self._bytes = bytes # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_v_self->_bytes = __pyx_v_bytes; + + /* "taos/_objects.pyx":200 + * cdef int32_t _bytes + * + * def __cinit__(self, str name, int8_t type_, int32_t bytes): # <<<<<<<<<<<<<< + * self._name = name + * self._type = type_ + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosField.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":205 + * self._bytes = bytes + * + * @property # <<<<<<<<<<<<<< + * def name(self): + * return self._name + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_4name_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_4name___get__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4name___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 205, 0, __PYX_ERR(0, 205, __pyx_L1_error)); + + /* "taos/_objects.pyx":207 + * @property + * def name(self): + * return self._name # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_name); + __pyx_r = __pyx_v_self->_name; + goto __pyx_L0; + + /* "taos/_objects.pyx":205 + * self._bytes = bytes + * + * @property # <<<<<<<<<<<<<< + * def name(self): + * return self._name + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosField.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":209 + * return self._name + * + * @property # <<<<<<<<<<<<<< + * def type(self): + * return self._type + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_4type_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_4type_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_4type___get__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4type___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 209, 0, __PYX_ERR(0, 209, __pyx_L1_error)); + + /* "taos/_objects.pyx":211 + * @property + * def type(self): + * return self._type # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_self->_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":209 + * return self._name + * + * @property # <<<<<<<<<<<<<< + * def type(self): + * return self._type + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosField.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":213 + * return self._type + * + * @property # <<<<<<<<<<<<<< + * def bytes(self): + * return self._bytes + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_5bytes_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_5bytes_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_5bytes___get__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_5bytes___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 213, 0, __PYX_ERR(0, 213, __pyx_L1_error)); + + /* "taos/_objects.pyx":215 + * @property + * def bytes(self): + * return self._bytes # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":213 + * return self._type + * + * @property # <<<<<<<<<<<<<< + * def bytes(self): + * return self._bytes + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosField.bytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":217 + * return self._bytes + * + * @property # <<<<<<<<<<<<<< + * def length(self): + * return self._bytes + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_6length_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_6length_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_6length___get__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_6length___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 217, 0, __PYX_ERR(0, 217, __pyx_L1_error)); + + /* "taos/_objects.pyx":219 + * @property + * def length(self): + * return self._bytes # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":217 + * return self._bytes + * + * @property # <<<<<<<<<<<<<< + * def length(self): + * return self._bytes + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosField.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":221 + * return self._bytes + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_3__str__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_2__str__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_2__str__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_UCS4 __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + __Pyx_TraceCall("__str__", __pyx_f[0], 221, 0, __PYX_ERR(0, 221, __pyx_L1_error)); + + /* "taos/_objects.pyx":222 + * + * def __str__(self): + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = 127; + __Pyx_INCREF(__pyx_kp_u_TaosField_name); + __pyx_t_2 += 16; + __Pyx_GIVEREF(__pyx_kp_u_TaosField_name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TaosField_name); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_kp_u_type_2); + __pyx_t_2 += 8; + __Pyx_GIVEREF(__pyx_kp_u_type_2); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_type_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_5), __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u_bytes_2); + __pyx_t_2 += 9; + __Pyx_GIVEREF(__pyx_kp_u_bytes_2); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_bytes_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_4), __pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_kp_u__19); + __pyx_t_2 += 1; + __Pyx_GIVEREF(__pyx_kp_u__19); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__19); + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":221 + * return self._bytes + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("taos._objects.TaosField.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":224 + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_5__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_5__repr__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_4__repr__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4__repr__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_UCS4 __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + __Pyx_TraceCall("__repr__", __pyx_f[0], 224, 0, __PYX_ERR(0, 224, __pyx_L1_error)); + + /* "taos/_objects.pyx":225 + * + * def __repr__(self): + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = 127; + __Pyx_INCREF(__pyx_kp_u_TaosField_name); + __pyx_t_2 += 16; + __Pyx_GIVEREF(__pyx_kp_u_TaosField_name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TaosField_name); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_kp_u_type_2); + __pyx_t_2 += 8; + __Pyx_GIVEREF(__pyx_kp_u_type_2); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_type_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_5), __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u_bytes_2); + __pyx_t_2 += 9; + __Pyx_GIVEREF(__pyx_kp_u_bytes_2); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_bytes_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_4), __pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_kp_u__19); + __pyx_t_2 += 1; + __Pyx_GIVEREF(__pyx_kp_u__19); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__19); + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":224 + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("taos._objects.TaosField.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":227 + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return getattr(self, item) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_6__getitem__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_6__getitem__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getitem__", 0); + __Pyx_TraceCall("__getitem__", __pyx_f[0], 227, 0, __PYX_ERR(0, 227, __pyx_L1_error)); + + /* "taos/_objects.pyx":228 + * + * def __getitem__(self, item): + * return getattr(self, item) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetAttr(((PyObject *)__pyx_v_self), __pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":227 + * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return getattr(self, item) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosField.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_9__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_9TaosField_8__reduce_cython__, "TaosField.__reduce_cython__(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_9TaosField_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_9TaosField_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_9TaosField_8__reduce_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_9__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_8__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__20) + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosField.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_11__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_9TaosField_10__setstate_cython__, "TaosField.__setstate_cython__(self, __pyx_state)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_9TaosField_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_9TaosField_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_9TaosField_10__setstate_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_9TaosField_11__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v___pyx_state = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosField.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_10__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self), __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_9TaosField_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__21) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); + + /* "(tree fragment)":4 + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosField.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":239 + * cdef int _affected_rows + * + * def __cinit__(self, size_t res): # <<<<<<<<<<<<<< + * self._res = res + * self._check_result_error() + */ + +/* Python wrapper */ +static int __pyx_pw_4taos_8_objects_10TaosResult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_4taos_8_objects_10TaosResult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + size_t __pyx_v_res; + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_res,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_res)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 239, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + } + __pyx_v_res = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_res == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 239, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult___cinit__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self), __pyx_v_res); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_4taos_8_objects_10TaosResult___cinit__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, size_t __pyx_v_res) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_TraceCall("__cinit__", __pyx_f[0], 239, 0, __PYX_ERR(0, 239, __pyx_L1_error)); + + /* "taos/_objects.pyx":240 + * + * def __cinit__(self, size_t res): + * self._res = res # <<<<<<<<<<<<<< + * self._check_result_error() + * self._field_count = taos_field_count(self._res) + */ + __pyx_v_self->_res = ((TAOS_RES *)__pyx_v_res); + + /* "taos/_objects.pyx":241 + * def __cinit__(self, size_t res): + * self._res = res + * self._check_result_error() # <<<<<<<<<<<<<< + * self._field_count = taos_field_count(self._res) + * self._fields = taos_fetch_fields(self._res) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_result_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_objects.pyx":242 + * self._res = res + * self._check_result_error() + * self._field_count = taos_field_count(self._res) # <<<<<<<<<<<<<< + * self._fields = taos_fetch_fields(self._res) + * self._precision = taos_result_precision(self._res) + */ + __pyx_v_self->_field_count = taos_field_count(__pyx_v_self->_res); + + /* "taos/_objects.pyx":243 + * self._check_result_error() + * self._field_count = taos_field_count(self._res) + * self._fields = taos_fetch_fields(self._res) # <<<<<<<<<<<<<< + * self._precision = taos_result_precision(self._res) + * self._affected_rows = taos_affected_rows(self._res) + */ + __pyx_v_self->_fields = taos_fetch_fields(__pyx_v_self->_res); + + /* "taos/_objects.pyx":244 + * self._field_count = taos_field_count(self._res) + * self._fields = taos_fetch_fields(self._res) + * self._precision = taos_result_precision(self._res) # <<<<<<<<<<<<<< + * self._affected_rows = taos_affected_rows(self._res) + * self._row_count = 0 + */ + __pyx_v_self->_precision = taos_result_precision(__pyx_v_self->_res); + + /* "taos/_objects.pyx":245 + * self._fields = taos_fetch_fields(self._res) + * self._precision = taos_result_precision(self._res) + * self._affected_rows = taos_affected_rows(self._res) # <<<<<<<<<<<<<< + * self._row_count = 0 + * + */ + __pyx_v_self->_affected_rows = taos_affected_rows(__pyx_v_self->_res); + + /* "taos/_objects.pyx":246 + * self._precision = taos_result_precision(self._res) + * self._affected_rows = taos_affected_rows(self._res) + * self._row_count = 0 # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_v_self->_row_count = 0; + + /* "taos/_objects.pyx":239 + * cdef int _affected_rows + * + * def __cinit__(self, size_t res): # <<<<<<<<<<<<<< + * self._res = res + * self._check_result_error() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("taos._objects.TaosResult.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":248 + * self._row_count = 0 + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "TaosResult{res: %s}" % (self._res, ) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_3__str__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_2__str__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_2__str__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_UCS4 __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + __Pyx_TraceCall("__str__", __pyx_f[0], 248, 0, __PYX_ERR(0, 248, __pyx_L1_error)); + + /* "taos/_objects.pyx":249 + * + * def __str__(self): + * return "TaosResult{res: %s}" % (self._res, ) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = 127; + __Pyx_INCREF(__pyx_kp_u_TaosResult_res); + __pyx_t_2 += 16; + __Pyx_GIVEREF(__pyx_kp_u_TaosResult_res); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TaosResult_res); + __pyx_t_4 = __Pyx_PyUnicode_From_size_t(((size_t)__pyx_v_self->_res), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u__19); + __pyx_t_2 += 1; + __Pyx_GIVEREF(__pyx_kp_u__19); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19); + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":248 + * self._row_count = 0 + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "TaosResult{res: %s}" % (self._res, ) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("taos._objects.TaosResult.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":251 + * return "TaosResult{res: %s}" % (self._res, ) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "TaosResult{res: %s}" % (self._res, ) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_5__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_5__repr__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_4__repr__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_4__repr__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_UCS4 __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + __Pyx_TraceCall("__repr__", __pyx_f[0], 251, 0, __PYX_ERR(0, 251, __pyx_L1_error)); + + /* "taos/_objects.pyx":252 + * + * def __repr__(self): + * return "TaosResult{res: %s}" % (self._res, ) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = 127; + __Pyx_INCREF(__pyx_kp_u_TaosResult_res); + __pyx_t_2 += 16; + __Pyx_GIVEREF(__pyx_kp_u_TaosResult_res); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TaosResult_res); + __pyx_t_4 = __Pyx_PyUnicode_From_size_t(((size_t)__pyx_v_self->_res), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u__19); + __pyx_t_2 += 1; + __Pyx_GIVEREF(__pyx_kp_u__19); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19); + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":251 + * return "TaosResult{res: %s}" % (self._res, ) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "TaosResult{res: %s}" % (self._res, ) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("taos._objects.TaosResult.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":254 + * return "TaosResult{res: %s}" % (self._res, ) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self.rows_iter() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_7__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_7__iter__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_6__iter__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_6__iter__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + __Pyx_TraceCall("__iter__", __pyx_f[0], 254, 0, __PYX_ERR(0, 254, __pyx_L1_error)); + + /* "taos/_objects.pyx":255 + * + * def __iter__(self): + * return self.rows_iter() # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rows_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":254 + * return "TaosResult{res: %s}" % (self._res, ) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self.rows_iter() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("taos._objects.TaosResult.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":257 + * return self.rows_iter() + * + * @property # <<<<<<<<<<<<<< + * def fields(self): + * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_6fields_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_6fields_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_6fields___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_6fields___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + TAOS_FIELD __pyx_8genexpr1__pyx_v_f; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + TAOS_FIELD *__pyx_t_2; + TAOS_FIELD *__pyx_t_3; + TAOS_FIELD *__pyx_t_4; + char *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 257, 0, __PYX_ERR(0, 257, __pyx_L1_error)); + + /* "taos/_objects.pyx":259 + * @property + * def fields(self): + * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->_fields + __pyx_v_self->_field_count); + for (__pyx_t_4 = __pyx_v_self->_fields; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_8genexpr1__pyx_v_f = (__pyx_t_2[0]); + __pyx_t_5 = __pyx_8genexpr1__pyx_v_f.name; + __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_5, 0, strlen(__pyx_t_5), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_int8_t(__pyx_8genexpr1__pyx_v_f.type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_8genexpr1__pyx_v_f.bytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4taos_8_objects_TaosField), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } /* exit inner scope */ + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":257 + * return self.rows_iter() + * + * @property # <<<<<<<<<<<<<< + * def fields(self): + * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("taos._objects.TaosResult.fields.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":261 + * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] + * + * @property # <<<<<<<<<<<<<< + * def field_count(self): + * return self._field_count + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_11field_count_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_11field_count_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_11field_count___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_11field_count___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error)); + + /* "taos/_objects.pyx":263 + * @property + * def field_count(self): + * return self._field_count # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_field_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":261 + * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] + * + * @property # <<<<<<<<<<<<<< + * def field_count(self): + * return self._field_count + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosResult.field_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":265 + * return self._field_count + * + * @property # <<<<<<<<<<<<<< + * def precision(self): + * return self._precision + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9precision_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9precision_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_9precision___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_9precision___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 265, 0, __PYX_ERR(0, 265, __pyx_L1_error)); + + /* "taos/_objects.pyx":267 + * @property + * def precision(self): + * return self._precision # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_precision); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":265 + * return self._field_count + * + * @property # <<<<<<<<<<<<<< + * def precision(self): + * return self._precision + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosResult.precision.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":269 + * return self._precision + * + * @property # <<<<<<<<<<<<<< + * def affected_rows(self): + * return self._affected_rows + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_13affected_rows_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_13affected_rows_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_13affected_rows___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_13affected_rows___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 269, 0, __PYX_ERR(0, 269, __pyx_L1_error)); + + /* "taos/_objects.pyx":271 + * @property + * def affected_rows(self): + * return self._affected_rows # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_affected_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":269 + * return self._precision + * + * @property # <<<<<<<<<<<<<< + * def affected_rows(self): + * return self._affected_rows + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosResult.affected_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":273 + * return self._affected_rows + * + * @property # <<<<<<<<<<<<<< + * def row_count(self): + * return self._row_count + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9row_count_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9row_count_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_9row_count___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_9row_count___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 273, 0, __PYX_ERR(0, 273, __pyx_L1_error)); + + /* "taos/_objects.pyx":275 + * @property + * def row_count(self): + * return self._row_count # <<<<<<<<<<<<<< + * + * def _check_result_error(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_row_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":273 + * return self._affected_rows + * + * @property # <<<<<<<<<<<<<< + * def row_count(self): + * return self._row_count + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosResult.row_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":277 + * return self._row_count + * + * def _check_result_error(self): # <<<<<<<<<<<<<< + * errno = taos_errno(self._res) + * if errno != 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9_check_result_error(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_8_check_result_error, "TaosResult._check_result_error(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_9_check_result_error = {"_check_result_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_9_check_result_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_8_check_result_error}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9_check_result_error(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_result_error (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("_check_result_error", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_check_result_error", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_8_check_result_error(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_8_check_result_error(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + int __pyx_v_errno; + char *__pyx_v_errstr; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__22) + __Pyx_RefNannySetupContext("_check_result_error", 0); + __Pyx_TraceCall("_check_result_error", __pyx_f[0], 277, 0, __PYX_ERR(0, 277, __pyx_L1_error)); + + /* "taos/_objects.pyx":278 + * + * def _check_result_error(self): + * errno = taos_errno(self._res) # <<<<<<<<<<<<<< + * if errno != 0: + * errstr = taos_errstr(self._res) + */ + __pyx_v_errno = taos_errno(__pyx_v_self->_res); + + /* "taos/_objects.pyx":279 + * def _check_result_error(self): + * errno = taos_errno(self._res) + * if errno != 0: # <<<<<<<<<<<<<< + * errstr = taos_errstr(self._res) + * raise ProgrammingError(errstr, errno) + */ + __pyx_t_1 = (__pyx_v_errno != 0); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":280 + * errno = taos_errno(self._res) + * if errno != 0: + * errstr = taos_errstr(self._res) # <<<<<<<<<<<<<< + * raise ProgrammingError(errstr, errno) + * + */ + __pyx_v_errstr = taos_errstr(__pyx_v_self->_res); + + /* "taos/_objects.pyx":281 + * if errno != 0: + * errstr = taos_errstr(self._res) + * raise ProgrammingError(errstr, errno) # <<<<<<<<<<<<<< + * + * def _fetch_block(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_errstr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 281, __pyx_L1_error) + + /* "taos/_objects.pyx":279 + * def _check_result_error(self): + * errno = taos_errno(self._res) + * if errno != 0: # <<<<<<<<<<<<<< + * errstr = taos_errstr(self._res) + * raise ProgrammingError(errstr, errno) + */ + } + + /* "taos/_objects.pyx":277 + * return self._row_count + * + * def _check_result_error(self): # <<<<<<<<<<<<<< + * errno = taos_errno(self._res) + * if errno != 0: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("taos._objects.TaosResult._check_result_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":283 + * raise ProgrammingError(errstr, errno) + * + * def _fetch_block(self): # <<<<<<<<<<<<<< + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(self._res, &pblock) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_11_fetch_block(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_10_fetch_block, "TaosResult._fetch_block(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_11_fetch_block = {"_fetch_block", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_11_fetch_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_10_fetch_block}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_11_fetch_block(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_fetch_block (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("_fetch_block", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_fetch_block", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_10_fetch_block(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_10_fetch_block(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + TAOS_ROW __pyx_v_pblock; + PyObject *__pyx_v_num_of_rows = NULL; + PyObject *__pyx_v_blocks = NULL; + PyObject *__pyx_v_dt_epoch = NULL; + int __pyx_v_i; + void *__pyx_v_data; + TAOS_FIELD __pyx_v_field; + int *__pyx_v_offsets; + PyObject *__pyx_v_is_null = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int8_t __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__23) + __Pyx_RefNannySetupContext("_fetch_block", 0); + __Pyx_TraceCall("_fetch_block", __pyx_f[0], 283, 0, __PYX_ERR(0, 283, __pyx_L1_error)); + + /* "taos/_objects.pyx":285 + * def _fetch_block(self): + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(self._res, &pblock) # <<<<<<<<<<<<<< + * if num_of_rows == 0: + * return [], 0 + */ + __pyx_t_1 = __Pyx_PyInt_From_int(taos_fetch_block(__pyx_v_self->_res, (&__pyx_v_pblock))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_num_of_rows = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":286 + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(self._res, &pblock) + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * return [], 0 + * + */ + __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) + if (__pyx_t_2) { + + /* "taos/_objects.pyx":287 + * num_of_rows = taos_fetch_block(self._res, &pblock) + * if num_of_rows == 0: + * return [], 0 # <<<<<<<<<<<<<< + * + * blocks = [None] * self._field_count + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":286 + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(self._res, &pblock) + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * return [], 0 + * + */ + } + + /* "taos/_objects.pyx":289 + * return [], 0 + * + * blocks = [None] * self._field_count # <<<<<<<<<<<<<< + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + * cdef int i + */ + __pyx_t_3 = PyList_New(1 * ((__pyx_v_self->_field_count<0) ? 0:__pyx_v_self->_field_count)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_self->_field_count; __pyx_temp++) { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None); + } + } + __pyx_v_blocks = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "taos/_objects.pyx":290 + * + * blocks = [None] * self._field_count + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch # <<<<<<<<<<<<<< + * cdef int i + * for i in range(self._field_count): + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_v_dt_epoch = __pyx_t_3; + __pyx_t_3 = 0; + + /* "taos/_objects.pyx":292 + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + * cdef int i + * for i in range(self._field_count): # <<<<<<<<<<<<<< + * data = pblock[i] + * field = self._fields[i] + */ + __pyx_t_4 = __pyx_v_self->_field_count; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "taos/_objects.pyx":293 + * cdef int i + * for i in range(self._field_count): + * data = pblock[i] # <<<<<<<<<<<<<< + * field = self._fields[i] + * + */ + __pyx_v_data = (__pyx_v_pblock[__pyx_v_i]); + + /* "taos/_objects.pyx":294 + * for i in range(self._field_count): + * data = pblock[i] + * field = self._fields[i] # <<<<<<<<<<<<<< + * + * if field.type in UNSIZED_TYPE: + */ + __pyx_v_field = (__pyx_v_self->_fields[__pyx_v_i]); + + /* "taos/_objects.pyx":296 + * field = self._fields[i] + * + * if field.type in UNSIZED_TYPE: # <<<<<<<<<<<<<< + * offsets = taos_get_column_data_offset(self._res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) + */ + __pyx_t_3 = __Pyx_PyInt_From_int8_t(__pyx_v_field.type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UNSIZED_TYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "taos/_objects.pyx":297 + * + * if field.type in UNSIZED_TYPE: + * offsets = taos_get_column_data_offset(self._res, i) # <<<<<<<<<<<<<< + * blocks[i] = _parse_string(data, num_of_rows, offsets) + * elif field.type in SIZED_TYPE: + */ + __pyx_v_offsets = taos_get_column_data_offset(__pyx_v_self->_res, __pyx_v_i); + + /* "taos/_objects.pyx":298 + * if field.type in UNSIZED_TYPE: + * offsets = taos_get_column_data_offset(self._res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) # <<<<<<<<<<<<<< + * elif field.type in SIZED_TYPE: + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + */ + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4taos_7_parser__parse_string(((size_t)__pyx_v_data), __pyx_t_7, __pyx_v_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_objects.pyx":296 + * field = self._fields[i] + * + * if field.type in UNSIZED_TYPE: # <<<<<<<<<<<<<< + * offsets = taos_get_column_data_offset(self._res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) + */ + goto __pyx_L6; + } + + /* "taos/_objects.pyx":299 + * offsets = taos_get_column_data_offset(self._res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) + * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + */ + __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_field.type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_2) { + + /* "taos/_objects.pyx":300 + * blocks[i] = _parse_string(data, num_of_rows, offsets) + * elif field.type in SIZED_TYPE: + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) # <<<<<<<<<<<<<< + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + */ + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(__pyx_v_self->_res, __pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_is_null, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "taos/_objects.pyx":301 + * elif field.type in SIZED_TYPE: + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) # <<<<<<<<<<<<<< + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CONVERT_FUNC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_field.type, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_1, __pyx_v_num_of_rows, __pyx_v_is_null}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":299 + * offsets = taos_get_column_data_offset(self._res, i) + * blocks[i] = _parse_string(data, num_of_rows, offsets) + * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + */ + goto __pyx_L6; + } + + /* "taos/_objects.pyx":302 + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) + */ + __pyx_t_10 = __pyx_v_field.type; + __pyx_t_2 = (__pyx_t_10 == TSDB_DATA_TYPE_TIMESTAMP); + if (__pyx_t_2) { + + /* "taos/_objects.pyx":303 + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) # <<<<<<<<<<<<<< + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) + * else: + */ + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(__pyx_v_self->_res, __pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_is_null, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "taos/_objects.pyx":304 + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) # <<<<<<<<<<<<<< + * else: + * pass + */ + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4taos_7_parser__parse_timestamp(((size_t)__pyx_v_data), __pyx_t_7, __pyx_v_is_null, __pyx_v_self->_precision, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":302 + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< + * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) + */ + goto __pyx_L6; + } + + /* "taos/_objects.pyx":306 + * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) + * else: + * pass # <<<<<<<<<<<<<< + * + * return blocks, abs(num_of_rows) + */ + /*else*/ { + } + __pyx_L6:; + } + + /* "taos/_objects.pyx":308 + * pass + * + * return blocks, abs(num_of_rows) # <<<<<<<<<<<<<< + * + * def fetch_block(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_num_of_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_blocks); + __Pyx_GIVEREF(__pyx_v_blocks); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_blocks); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":283 + * raise ProgrammingError(errstr, errno) + * + * def _fetch_block(self): # <<<<<<<<<<<<<< + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(self._res, &pblock) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("taos._objects.TaosResult._fetch_block", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_num_of_rows); + __Pyx_XDECREF(__pyx_v_blocks); + __Pyx_XDECREF(__pyx_v_dt_epoch); + __Pyx_XDECREF(__pyx_v_is_null); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":310 + * return blocks, abs(num_of_rows) + * + * def fetch_block(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetch iterator") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_13fetch_block(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_12fetch_block, "TaosResult.fetch_block(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_13fetch_block = {"fetch_block", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_13fetch_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_12fetch_block}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_13fetch_block(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetch_block (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("fetch_block", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetch_block", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_12fetch_block(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_12fetch_block(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_v_block = NULL; + PyObject *__pyx_v_num_of_rows = NULL; + PyObject *__pyx_8genexpr2__pyx_v_r = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__24) + __Pyx_RefNannySetupContext("fetch_block", 0); + __Pyx_TraceCall("fetch_block", __pyx_f[0], 310, 0, __PYX_ERR(0, 310, __pyx_L1_error)); + + /* "taos/_objects.pyx":311 + * + * def fetch_block(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of fetch iterator") + * + */ + __pyx_t_1 = (__pyx_v_self->_res == NULL); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":312 + * def fetch_block(self): + * if self._res is NULL: + * raise OperationalError("Invalid use of fetch iterator") # <<<<<<<<<<<<<< + * + * block, num_of_rows = self._fetch_block() + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_fetch_iterator}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 312, __pyx_L1_error) + + /* "taos/_objects.pyx":311 + * + * def fetch_block(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of fetch iterator") + * + */ + } + + /* "taos/_objects.pyx":314 + * raise OperationalError("Invalid use of fetch iterator") + * + * block, num_of_rows = self._fetch_block() # <<<<<<<<<<<<<< + * self._row_count += num_of_rows + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch_block); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_4, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 314, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_L5_unpacking_done:; + } + __pyx_v_block = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_num_of_rows = __pyx_t_4; + __pyx_t_4 = 0; + + /* "taos/_objects.pyx":315 + * + * block, num_of_rows = self._fetch_block() + * self._row_count += num_of_rows # <<<<<<<<<<<<<< + * + * return [r for r in map(tuple, zip(*block))], num_of_rows + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_row_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_num_of_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_self->_row_count = __pyx_t_5; + + /* "taos/_objects.pyx":317 + * self._row_count += num_of_rows + * + * return [r for r in map(tuple, zip(*block))], num_of_rows # <<<<<<<<<<<<<< + * + * def fetch_all(self): + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_block); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF((PyObject *)(&PyTuple_Type)); + __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyTuple_Type))); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 317, __pyx_L8_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 317, __pyx_L8_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 317, __pyx_L8_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_9(__pyx_t_2); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 317, __pyx_L8_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_r, __pyx_t_3); + __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_8genexpr2__pyx_v_r))) __PYX_ERR(0, 317, __pyx_L8_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_r); __pyx_8genexpr2__pyx_v_r = 0; + goto __pyx_L12_exit_scope; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_r); __pyx_8genexpr2__pyx_v_r = 0; + goto __pyx_L1_error; + __pyx_L12_exit_scope:; + } /* exit inner scope */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_INCREF(__pyx_v_num_of_rows); + __Pyx_GIVEREF(__pyx_v_num_of_rows); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_num_of_rows); + __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":310 + * return blocks, abs(num_of_rows) + * + * def fetch_block(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetch iterator") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("taos._objects.TaosResult.fetch_block", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_block); + __Pyx_XDECREF(__pyx_v_num_of_rows); + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_r); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":319 + * return [r for r in map(tuple, zip(*block))], num_of_rows + * + * def fetch_all(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_15fetch_all(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_14fetch_all, "TaosResult.fetch_all(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_15fetch_all = {"fetch_all", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_15fetch_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_14fetch_all}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_15fetch_all(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetch_all (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("fetch_all", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetch_all", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_14fetch_all(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_14fetch_all(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_v_blocks = NULL; + PyObject *__pyx_v_block = NULL; + PyObject *__pyx_v_num_of_rows = NULL; + PyObject *__pyx_8genexpr3__pyx_v_b = NULL; + PyObject *__pyx_8genexpr3__pyx_v_r = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__25) + __Pyx_RefNannySetupContext("fetch_all", 0); + __Pyx_TraceCall("fetch_all", __pyx_f[0], 319, 0, __PYX_ERR(0, 319, __pyx_L1_error)); + + /* "taos/_objects.pyx":320 + * + * def fetch_all(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of fetchall") + * + */ + __pyx_t_1 = (__pyx_v_self->_res == NULL); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":321 + * def fetch_all(self): + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") # <<<<<<<<<<<<<< + * + * blocks = [] + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_fetchall}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 321, __pyx_L1_error) + + /* "taos/_objects.pyx":320 + * + * def fetch_all(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of fetchall") + * + */ + } + + /* "taos/_objects.pyx":323 + * raise OperationalError("Invalid use of fetchall") + * + * blocks = [] # <<<<<<<<<<<<<< + * while True: + * block, num_of_rows = self._fetch_block() + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_blocks = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":324 + * + * blocks = [] + * while True: # <<<<<<<<<<<<<< + * block, num_of_rows = self._fetch_block() + * self._check_result_error() + */ + while (1) { + + /* "taos/_objects.pyx":325 + * blocks = [] + * while True: + * block, num_of_rows = self._fetch_block() # <<<<<<<<<<<<<< + * self._check_result_error() + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch_block); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_4, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 325, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_block, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_num_of_rows, __pyx_t_4); + __pyx_t_4 = 0; + + /* "taos/_objects.pyx":326 + * while True: + * block, num_of_rows = self._fetch_block() + * self._check_result_error() # <<<<<<<<<<<<<< + * + * if num_of_rows == 0: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_result_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":328 + * self._check_result_error() + * + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":329 + * + * if num_of_rows == 0: + * break # <<<<<<<<<<<<<< + * + * self._row_count += num_of_rows + */ + goto __pyx_L5_break; + + /* "taos/_objects.pyx":328 + * self._check_result_error() + * + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "taos/_objects.pyx":331 + * break + * + * self._row_count += num_of_rows # <<<<<<<<<<<<<< + * blocks.append(block) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_row_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_num_of_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_self->_row_count = __pyx_t_5; + + /* "taos/_objects.pyx":332 + * + * self._row_count += num_of_rows + * blocks.append(block) # <<<<<<<<<<<<<< + * + * return [r for b in blocks for r in map(tuple, zip(*b))] + */ + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_blocks, __pyx_v_block); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 332, __pyx_L1_error) + } + __pyx_L5_break:; + + /* "taos/_objects.pyx":334 + * blocks.append(block) + * + * return [r for b in blocks for r in map(tuple, zip(*b))] # <<<<<<<<<<<<<< + * + * def fetch_all_into_dict(self): + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_v_blocks; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; + for (;;) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 334, __pyx_L11_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_b, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_8genexpr3__pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF((PyObject *)(&PyTuple_Type)); + __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyTuple_Type))); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 334, __pyx_L11_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 334, __pyx_L11_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 334, __pyx_L11_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_11(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 334, __pyx_L11_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_r, __pyx_t_6); + __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_8genexpr3__pyx_v_r))) __PYX_ERR(0, 334, __pyx_L11_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_b); __pyx_8genexpr3__pyx_v_b = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_r); __pyx_8genexpr3__pyx_v_r = 0; + goto __pyx_L18_exit_scope; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_b); __pyx_8genexpr3__pyx_v_b = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_r); __pyx_8genexpr3__pyx_v_r = 0; + goto __pyx_L1_error; + __pyx_L18_exit_scope:; + } /* exit inner scope */ + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":319 + * return [r for r in map(tuple, zip(*block))], num_of_rows + * + * def fetch_all(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("taos._objects.TaosResult.fetch_all", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_blocks); + __Pyx_XDECREF(__pyx_v_block); + __Pyx_XDECREF(__pyx_v_num_of_rows); + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_b); + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_r); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":336 + * return [r for b in blocks for r in map(tuple, zip(*b))] + * + * def fetch_all_into_dict(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_17fetch_all_into_dict(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_16fetch_all_into_dict, "TaosResult.fetch_all_into_dict(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_17fetch_all_into_dict = {"fetch_all_into_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_17fetch_all_into_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_16fetch_all_into_dict}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_17fetch_all_into_dict(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetch_all_into_dict (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("fetch_all_into_dict", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetch_all_into_dict", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_16fetch_all_into_dict(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_16fetch_all_into_dict(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_v_field_names = NULL; + PyObject *__pyx_v_dict_row_cls = NULL; + PyObject *__pyx_v_blocks = NULL; + PyObject *__pyx_v_block = NULL; + PyObject *__pyx_v_num_of_rows = NULL; + PyObject *__pyx_8genexpr4__pyx_v_field = NULL; + PyObject *__pyx_8genexpr5__pyx_v_b = NULL; + PyObject *__pyx_8genexpr5__pyx_v_r = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__26) + __Pyx_RefNannySetupContext("fetch_all_into_dict", 0); + __Pyx_TraceCall("fetch_all_into_dict", __pyx_f[0], 336, 0, __PYX_ERR(0, 336, __pyx_L1_error)); + + /* "taos/_objects.pyx":337 + * + * def fetch_all_into_dict(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of fetchall") + * + */ + __pyx_t_1 = (__pyx_v_self->_res == NULL); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":338 + * def fetch_all_into_dict(self): + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") # <<<<<<<<<<<<<< + * + * field_names = [field.name for field in self.fields] + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_fetchall}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 338, __pyx_L1_error) + + /* "taos/_objects.pyx":337 + * + * def fetch_all_into_dict(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of fetchall") + * + */ + } + + /* "taos/_objects.pyx":340 + * raise OperationalError("Invalid use of fetchall") + * + * field_names = [field.name for field in self.fields] # <<<<<<<<<<<<<< + * dict_row_cls = namedtuple('DictRow', field_names) + * blocks = [] + */ + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L6_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L6_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L6_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_7(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 340, __pyx_L6_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_field, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr4__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 340, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_field); __pyx_8genexpr4__pyx_v_field = 0; + goto __pyx_L10_exit_scope; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_field); __pyx_8genexpr4__pyx_v_field = 0; + goto __pyx_L1_error; + __pyx_L10_exit_scope:; + } /* exit inner scope */ + __pyx_v_field_names = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":341 + * + * field_names = [field.name for field in self.fields] + * dict_row_cls = namedtuple('DictRow', field_names) # <<<<<<<<<<<<<< + * blocks = [] + * while True: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_u_DictRow, __pyx_v_field_names}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_v_dict_row_cls = __pyx_t_2; + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":342 + * field_names = [field.name for field in self.fields] + * dict_row_cls = namedtuple('DictRow', field_names) + * blocks = [] # <<<<<<<<<<<<<< + * while True: + * block, num_of_rows = self._fetch_block() + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_blocks = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":343 + * dict_row_cls = namedtuple('DictRow', field_names) + * blocks = [] + * while True: # <<<<<<<<<<<<<< + * block, num_of_rows = self._fetch_block() + * self._check_result_error() + */ + while (1) { + + /* "taos/_objects.pyx":344 + * blocks = [] + * while True: + * block, num_of_rows = self._fetch_block() # <<<<<<<<<<<<<< + * self._check_result_error() + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch_block); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 344, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L13_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L13_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L14_unpacking_done; + __pyx_L13_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_L14_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_block, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_num_of_rows, __pyx_t_3); + __pyx_t_3 = 0; + + /* "taos/_objects.pyx":345 + * while True: + * block, num_of_rows = self._fetch_block() + * self._check_result_error() # <<<<<<<<<<<<<< + * + * if num_of_rows == 0: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_result_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_4, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":347 + * self._check_result_error() + * + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":348 + * + * if num_of_rows == 0: + * break # <<<<<<<<<<<<<< + * + * self._row_count += num_of_rows + */ + goto __pyx_L12_break; + + /* "taos/_objects.pyx":347 + * self._check_result_error() + * + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "taos/_objects.pyx":350 + * break + * + * self._row_count += num_of_rows # <<<<<<<<<<<<<< + * blocks.append(block) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_row_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_num_of_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self->_row_count = __pyx_t_5; + + /* "taos/_objects.pyx":351 + * + * self._row_count += num_of_rows + * blocks.append(block) # <<<<<<<<<<<<<< + * + * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_blocks, __pyx_v_block); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 351, __pyx_L1_error) + } + __pyx_L12_break:; + + /* "taos/_objects.pyx":353 + * blocks.append(block) + * + * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] # <<<<<<<<<<<<<< + * + * def rows_iter(self): + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_v_blocks; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + for (;;) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 353, __pyx_L18_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_b, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_8genexpr5__pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF((PyObject *)(&PyTuple_Type)); + __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyTuple_Type))); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { + __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L18_error) + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 353, __pyx_L18_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } else { + if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 353, __pyx_L18_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } + } else { + __pyx_t_8 = __pyx_t_7(__pyx_t_4); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 353, __pyx_L18_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_r, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_8genexpr5__pyx_v_r); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_v_dict_row_cls, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asdict); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_13, }; + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 353, __pyx_L18_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_b); __pyx_8genexpr5__pyx_v_b = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_r); __pyx_8genexpr5__pyx_v_r = 0; + goto __pyx_L25_exit_scope; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_b); __pyx_8genexpr5__pyx_v_b = 0; + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_r); __pyx_8genexpr5__pyx_v_r = 0; + goto __pyx_L1_error; + __pyx_L25_exit_scope:; + } /* exit inner scope */ + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":336 + * return [r for b in blocks for r in map(tuple, zip(*b))] + * + * def fetch_all_into_dict(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("taos._objects.TaosResult.fetch_all_into_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_field_names); + __Pyx_XDECREF(__pyx_v_dict_row_cls); + __Pyx_XDECREF(__pyx_v_blocks); + __Pyx_XDECREF(__pyx_v_block); + __Pyx_XDECREF(__pyx_v_num_of_rows); + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_field); + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_b); + __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_r); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_4taos_8_objects_10TaosResult_20generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "taos/_objects.pyx":355 + * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] + * + * def rows_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_19rows_iter(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_18rows_iter, "TaosResult.rows_iter(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_19rows_iter = {"rows_iter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_19rows_iter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_18rows_iter}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_19rows_iter(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rows_iter (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("rows_iter", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rows_iter", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_18rows_iter(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_18rows_iter(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("rows_iter", 0); + __pyx_cur_scope = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter(__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 355, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_self = __pyx_v_self; + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4taos_8_objects_10TaosResult_20generator, __pyx_codeobj__27, (PyObject *) __pyx_cur_scope, __pyx_n_s_rows_iter, __pyx_n_s_TaosResult_rows_iter, __pyx_n_s_taos__objects); if (unlikely(!gen)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.rows_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_4taos_8_objects_10TaosResult_20generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *__pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int8_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rows_iter", 0); + __Pyx_TraceFrameInit(__pyx_codeobj__27) + __Pyx_TraceCall("rows_iter", __pyx_f[0], 355, 0, __PYX_ERR(0, 355, __pyx_L1_error)); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L15_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 355, __pyx_L1_error) + + /* "taos/_objects.pyx":356 + * + * def rows_iter(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of rows_iter") + * + */ + __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->_res == NULL); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":357 + * def rows_iter(self): + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") # <<<<<<<<<<<<<< + * + * cdef TAOS_ROW taos_row + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_rows_iter}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 357, __pyx_L1_error) + + /* "taos/_objects.pyx":356 + * + * def rows_iter(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of rows_iter") + * + */ + } + + /* "taos/_objects.pyx":361 + * cdef TAOS_ROW taos_row + * cdef int i + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch # <<<<<<<<<<<<<< + * is_null = [False] + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } + __Pyx_GIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_v_dt_epoch = __pyx_t_2; + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":362 + * cdef int i + * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + * is_null = [False] # <<<<<<<<<<<<<< + * + * while True: + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + PyList_SET_ITEM(__pyx_t_2, 0, Py_False); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_v_is_null = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":364 + * is_null = [False] + * + * while True: # <<<<<<<<<<<<<< + * taos_row = taos_fetch_row(self._res) + * if taos_row is NULL: + */ + while (1) { + + /* "taos/_objects.pyx":365 + * + * while True: + * taos_row = taos_fetch_row(self._res) # <<<<<<<<<<<<<< + * if taos_row is NULL: + * break + */ + __pyx_cur_scope->__pyx_v_taos_row = taos_fetch_row(__pyx_cur_scope->__pyx_v_self->_res); + + /* "taos/_objects.pyx":366 + * while True: + * taos_row = taos_fetch_row(self._res) + * if taos_row is NULL: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_1 = (__pyx_cur_scope->__pyx_v_taos_row == NULL); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":367 + * taos_row = taos_fetch_row(self._res) + * if taos_row is NULL: + * break # <<<<<<<<<<<<<< + * + * row = [None] * self._field_count + */ + goto __pyx_L6_break; + + /* "taos/_objects.pyx":366 + * while True: + * taos_row = taos_fetch_row(self._res) + * if taos_row is NULL: # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "taos/_objects.pyx":369 + * break + * + * row = [None] * self._field_count # <<<<<<<<<<<<<< + * for i in range(self._field_count): + * data = taos_row[i] + */ + __pyx_t_2 = PyList_New(1 * ((__pyx_cur_scope->__pyx_v_self->_field_count<0) ? 0:__pyx_cur_scope->__pyx_v_self->_field_count)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_cur_scope->__pyx_v_self->_field_count; __pyx_temp++) { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyList_SET_ITEM(__pyx_t_2, __pyx_temp, Py_None); + } + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "taos/_objects.pyx":370 + * + * row = [None] * self._field_count + * for i in range(self._field_count): # <<<<<<<<<<<<<< + * data = taos_row[i] + * field = self._fields[i] + */ + __pyx_t_5 = __pyx_cur_scope->__pyx_v_self->_field_count; + __pyx_t_6 = __pyx_t_5; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_cur_scope->__pyx_v_i = __pyx_t_7; + + /* "taos/_objects.pyx":371 + * row = [None] * self._field_count + * for i in range(self._field_count): + * data = taos_row[i] # <<<<<<<<<<<<<< + * field = self._fields[i] + * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): + */ + __pyx_cur_scope->__pyx_v_data = (__pyx_cur_scope->__pyx_v_taos_row[__pyx_cur_scope->__pyx_v_i]); + + /* "taos/_objects.pyx":372 + * for i in range(self._field_count): + * data = taos_row[i] + * field = self._fields[i] # <<<<<<<<<<<<<< + * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): + * row[i] = _parse_binary_string(data, 1, field.bytes)[0] + */ + __pyx_cur_scope->__pyx_v_field = (__pyx_cur_scope->__pyx_v_self->_fields[__pyx_cur_scope->__pyx_v_i]); + + /* "taos/_objects.pyx":373 + * data = taos_row[i] + * field = self._fields[i] + * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): # <<<<<<<<<<<<<< + * row[i] = _parse_binary_string(data, 1, field.bytes)[0] + * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): + */ + __pyx_t_8 = __pyx_cur_scope->__pyx_v_field.type; + __pyx_t_9 = (__pyx_t_8 == TSDB_DATA_TYPE_BINARY); + if (!__pyx_t_9) { + } else { + __pyx_t_1 = __pyx_t_9; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_9 = (__pyx_t_8 == TSDB_DATA_TYPE_VARBINARY); + __pyx_t_1 = __pyx_t_9; + __pyx_L11_bool_binop_done:; + __pyx_t_9 = __pyx_t_1; + if (__pyx_t_9) { + + /* "taos/_objects.pyx":374 + * field = self._fields[i] + * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): + * row[i] = _parse_binary_string(data, 1, field.bytes)[0] # <<<<<<<<<<<<<< + * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): + * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] + */ + __pyx_t_2 = __pyx_f_4taos_7_parser__parse_binary_string(((size_t)__pyx_cur_scope->__pyx_v_data), 1, __pyx_cur_scope->__pyx_v_field.bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_t_2 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 374, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely((__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":373 + * data = taos_row[i] + * field = self._fields[i] + * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): # <<<<<<<<<<<<<< + * row[i] = _parse_binary_string(data, 1, field.bytes)[0] + * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): + */ + goto __pyx_L10; + } + + /* "taos/_objects.pyx":375 + * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): + * row[i] = _parse_binary_string(data, 1, field.bytes)[0] + * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): # <<<<<<<<<<<<<< + * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] + * elif field.type in SIZED_TYPE: + */ + __pyx_t_8 = __pyx_cur_scope->__pyx_v_field.type; + __pyx_t_1 = (__pyx_t_8 == TSDB_DATA_TYPE_NCHAR); + if (!__pyx_t_1) { + } else { + __pyx_t_9 = __pyx_t_1; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_1 = (__pyx_t_8 == TSDB_DATA_TYPE_VARCHAR); + __pyx_t_9 = __pyx_t_1; + __pyx_L13_bool_binop_done:; + __pyx_t_1 = __pyx_t_9; + if (__pyx_t_1) { + + /* "taos/_objects.pyx":376 + * row[i] = _parse_binary_string(data, 1, field.bytes)[0] + * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): + * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] # <<<<<<<<<<<<<< + * elif field.type in SIZED_TYPE: + * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] + */ + __pyx_t_3 = __pyx_f_4taos_7_parser__parse_nchar_string(((size_t)__pyx_cur_scope->__pyx_v_data), 1, __pyx_cur_scope->__pyx_v_field.bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 376, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely((__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":375 + * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): + * row[i] = _parse_binary_string(data, 1, field.bytes)[0] + * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): # <<<<<<<<<<<<<< + * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] + * elif field.type in SIZED_TYPE: + */ + goto __pyx_L10; + } + + /* "taos/_objects.pyx":377 + * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): + * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] + * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< + * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + */ + __pyx_t_2 = __Pyx_PyInt_From_int8_t(__pyx_cur_scope->__pyx_v_field.type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { + + /* "taos/_objects.pyx":378 + * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] + * elif field.type in SIZED_TYPE: + * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] # <<<<<<<<<<<<<< + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CONVERT_FUNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_cur_scope->__pyx_v_field.type, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_cur_scope->__pyx_v_data)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_11 = 1; + } + } + { + PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_t_2, __pyx_int_1, __pyx_cur_scope->__pyx_v_is_null}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_11, 3+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely((__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, __pyx_t_4, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "taos/_objects.pyx":377 + * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): + * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] + * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< + * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + */ + goto __pyx_L10; + } + + /* "taos/_objects.pyx":379 + * elif field.type in SIZED_TYPE: + * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< + * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] + * else: + */ + __pyx_t_8 = __pyx_cur_scope->__pyx_v_field.type; + __pyx_t_1 = (__pyx_t_8 == TSDB_DATA_TYPE_TIMESTAMP); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":380 + * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] # <<<<<<<<<<<<<< + * else: + * pass + */ + __pyx_t_4 = __pyx_f_4taos_7_parser__parse_timestamp(((size_t)__pyx_cur_scope->__pyx_v_data), 1, __pyx_cur_scope->__pyx_v_is_null, __pyx_cur_scope->__pyx_v_self->_precision, __pyx_cur_scope->__pyx_v_dt_epoch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(__pyx_t_4 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 380, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely((__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":379 + * elif field.type in SIZED_TYPE: + * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] + * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< + * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] + * else: + */ + goto __pyx_L10; + } + + /* "taos/_objects.pyx":382 + * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] + * else: + * pass # <<<<<<<<<<<<<< + * + * self._row_count += 1 + */ + /*else*/ { + } + __pyx_L10:; + } + + /* "taos/_objects.pyx":384 + * pass + * + * self._row_count += 1 # <<<<<<<<<<<<<< + * yield row + * + */ + __pyx_cur_scope->__pyx_v_self->_row_count = (__pyx_cur_scope->__pyx_v_self->_row_count + 1); + + /* "taos/_objects.pyx":385 + * + * self._row_count += 1 + * yield row # <<<<<<<<<<<<<< + * + * def blocks_iter(self): + */ + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_row); + __pyx_r = __pyx_cur_scope->__pyx_v_row; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L15_resume_from_yield:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 385, __pyx_L1_error) + } + __pyx_L6_break:; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* "taos/_objects.pyx":355 + * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] + * + * def rows_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("rows_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_4taos_8_objects_10TaosResult_23generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "taos/_objects.pyx":387 + * yield row + * + * def blocks_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_22blocks_iter(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_21blocks_iter, "TaosResult.blocks_iter(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_22blocks_iter = {"blocks_iter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_22blocks_iter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_21blocks_iter}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_22blocks_iter(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("blocks_iter (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("blocks_iter", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "blocks_iter", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_21blocks_iter(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_21blocks_iter(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("blocks_iter", 0); + __pyx_cur_scope = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter(__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 387, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_self = __pyx_v_self; + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4taos_8_objects_10TaosResult_23generator1, __pyx_codeobj__28, (PyObject *) __pyx_cur_scope, __pyx_n_s_blocks_iter, __pyx_n_s_TaosResult_blocks_iter, __pyx_n_s_taos__objects); if (unlikely(!gen)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.blocks_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_4taos_8_objects_10TaosResult_23generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *__pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("blocks_iter", 0); + __Pyx_TraceFrameInit(__pyx_codeobj__28) + __Pyx_TraceCall("blocks_iter", __pyx_f[0], 387, 0, __PYX_ERR(0, 387, __pyx_L1_error)); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L13_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 387, __pyx_L1_error) + + /* "taos/_objects.pyx":388 + * + * def blocks_iter(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of rows_iter") + * + */ + __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->_res == NULL); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":389 + * def blocks_iter(self): + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") # <<<<<<<<<<<<<< + * + * while True: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_rows_iter}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 389, __pyx_L1_error) + + /* "taos/_objects.pyx":388 + * + * def blocks_iter(self): + * if self._res is NULL: # <<<<<<<<<<<<<< + * raise OperationalError("Invalid use of rows_iter") + * + */ + } + + /* "taos/_objects.pyx":391 + * raise OperationalError("Invalid use of rows_iter") + * + * while True: # <<<<<<<<<<<<<< + * block, num_of_rows = self._fetch_block() + * + */ + while (1) { + + /* "taos/_objects.pyx":392 + * + * while True: + * block, num_of_rows = self._fetch_block() # <<<<<<<<<<<<<< + * + * if num_of_rows == 0: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_fetch_block); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_4, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 392, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L8_unpacking_done; + __pyx_L7_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_L8_unpacking_done:; + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_block); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_block, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_num_of_rows); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_num_of_rows, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "taos/_objects.pyx":394 + * block, num_of_rows = self._fetch_block() + * + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_cur_scope->__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 394, __pyx_L1_error) + if (__pyx_t_1) { + + /* "taos/_objects.pyx":395 + * + * if num_of_rows == 0: + * break # <<<<<<<<<<<<<< + * + * yield [r for r in map(tuple, zip(*block))], num_of_rows + */ + goto __pyx_L6_break; + + /* "taos/_objects.pyx":394 + * block, num_of_rows = self._fetch_block() + * + * if num_of_rows == 0: # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "taos/_objects.pyx":397 + * break + * + * yield [r for r in map(tuple, zip(*block))], num_of_rows # <<<<<<<<<<<<<< + * + * def fetch_rows_a(self, callback): + */ + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_block); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF((PyObject *)(&PyTuple_Type)); + __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyTuple_Type))); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 397, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 397, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 397, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_9(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 397, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_8genexpr6__pyx_v_r); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_8genexpr6__pyx_v_r, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_cur_scope->__pyx_8genexpr6__pyx_v_r))) __PYX_ERR(0, 397, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } /* exit inner scope */ + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_num_of_rows); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_num_of_rows); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_num_of_rows); + __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L13_resume_from_yield:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 397, __pyx_L1_error) + } + __pyx_L6_break:; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* "taos/_objects.pyx":387 + * yield row + * + * def blocks_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("blocks_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":399 + * yield [r for r in map(tuple, zip(*block))], num_of_rows + * + * def fetch_rows_a(self, callback): # <<<<<<<<<<<<<< + * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_25fetch_rows_a(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_24fetch_rows_a, "TaosResult.fetch_rows_a(self, callback)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_25fetch_rows_a = {"fetch_rows_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_25fetch_rows_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_24fetch_rows_a}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_25fetch_rows_a(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_callback = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetch_rows_a (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback_2,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback_2)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetch_rows_a") < 0)) __PYX_ERR(0, 399, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fetch_rows_a", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 399, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.fetch_rows_a", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_24fetch_rows_a(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self), __pyx_v_callback); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_24fetch_rows_a(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__29) + __Pyx_RefNannySetupContext("fetch_rows_a", 0); + __Pyx_TraceCall("fetch_rows_a", __pyx_f[0], 399, 0, __PYX_ERR(0, 399, __pyx_L1_error)); + + /* "taos/_objects.pyx":400 + * + * def fetch_rows_a(self, callback): + * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) # <<<<<<<<<<<<<< + * + * def taos_fetch_raw_block_a(self, callback): + */ + taos_fetch_rows_a(__pyx_v_self->_res, __pyx_f_4taos_8_objects_async_callback_wrapper, ((void *)__pyx_v_callback)); + + /* "taos/_objects.pyx":399 + * yield [r for r in map(tuple, zip(*block))], num_of_rows + * + * def fetch_rows_a(self, callback): # <<<<<<<<<<<<<< + * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.fetch_rows_a", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":402 + * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + * + * def taos_fetch_raw_block_a(self, callback): # <<<<<<<<<<<<<< + * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a, "TaosResult.taos_fetch_raw_block_a(self, callback)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a = {"taos_fetch_raw_block_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_callback = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("taos_fetch_raw_block_a (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback_2,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback_2)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "taos_fetch_raw_block_a") < 0)) __PYX_ERR(0, 402, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("taos_fetch_raw_block_a", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 402, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.taos_fetch_raw_block_a", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self), __pyx_v_callback); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__30) + __Pyx_RefNannySetupContext("taos_fetch_raw_block_a", 0); + __Pyx_TraceCall("taos_fetch_raw_block_a", __pyx_f[0], 402, 0, __PYX_ERR(0, 402, __pyx_L1_error)); + + /* "taos/_objects.pyx":403 + * + * def taos_fetch_raw_block_a(self, callback): + * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + taos_fetch_raw_block_a(__pyx_v_self->_res, __pyx_f_4taos_8_objects_async_callback_wrapper, ((void *)__pyx_v_callback)); + + /* "taos/_objects.pyx":402 + * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + * + * def taos_fetch_raw_block_a(self, callback): # <<<<<<<<<<<<<< + * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.taos_fetch_raw_block_a", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":405 + * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self._res is not NULL: + * taos_free_result(self._res) + */ + +/* Python wrapper */ +static void __pyx_pw_4taos_8_objects_10TaosResult_29__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_4taos_8_objects_10TaosResult_29__dealloc__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_4taos_8_objects_10TaosResult_28__dealloc__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_4taos_8_objects_10TaosResult_28__dealloc__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__dealloc__", 0); + __Pyx_TraceCall("__dealloc__", __pyx_f[0], 405, 0, __PYX_ERR(0, 405, __pyx_L1_error)); + + /* "taos/_objects.pyx":406 + * + * def __dealloc__(self): + * if self._res is not NULL: # <<<<<<<<<<<<<< + * taos_free_result(self._res) + * + */ + __pyx_t_1 = (__pyx_v_self->_res != NULL); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":407 + * def __dealloc__(self): + * if self._res is not NULL: + * taos_free_result(self._res) # <<<<<<<<<<<<<< + * + * self._res = NULL + */ + taos_free_result(__pyx_v_self->_res); + + /* "taos/_objects.pyx":406 + * + * def __dealloc__(self): + * if self._res is not NULL: # <<<<<<<<<<<<<< + * taos_free_result(self._res) + * + */ + } + + /* "taos/_objects.pyx":409 + * taos_free_result(self._res) + * + * self._res = NULL # <<<<<<<<<<<<<< + * self._fields = NULL + * + */ + __pyx_v_self->_res = NULL; + + /* "taos/_objects.pyx":410 + * + * self._res = NULL + * self._fields = NULL # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->_fields = NULL; + + /* "taos/_objects.pyx":405 + * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self._res is not NULL: + * taos_free_result(self._res) + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("taos._objects.TaosResult.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_31__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_30__reduce_cython__, "TaosResult.__reduce_cython__(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_31__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_30__reduce_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_31__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_30__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__31) + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_33__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_32__setstate_cython__, "TaosResult.__setstate_cython__(self, __pyx_state)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_33__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_32__setstate_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_33__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v___pyx_state = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_32__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self), __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__32) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); + + /* "(tree fragment)":4 + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosResult.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":418 + * cdef TaosResult _result + * + * def __init__(self, connection: TaosConnection=None) -> None: # <<<<<<<<<<<<<< + * self._description = [] + * self._connection = connection + */ + +/* Python wrapper */ +static int __pyx_pw_4taos_8_objects_10TaosCursor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_4taos_8_objects_10TaosCursor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_connection = 0; + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_connection,0}; + PyObject* values[1] = {0}; + values[0] = (PyObject *)((struct __pyx_obj_4taos_8_objects_TaosConnection *)Py_None); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_connection); + if (value) { values[0] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 418, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 418, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosCursor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_connection), __pyx_ptype_4taos_8_objects_TaosConnection, 1, "connection", 0))) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor___init__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self), __pyx_v_connection); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_4taos_8_objects_10TaosCursor___init__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_connection) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_TraceCall("__init__", __pyx_f[0], 418, 0, __PYX_ERR(0, 418, __pyx_L1_error)); + + /* "taos/_objects.pyx":419 + * + * def __init__(self, connection: TaosConnection=None) -> None: + * self._description = [] # <<<<<<<<<<<<<< + * self._connection = connection + * self._result = None + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_description); + __Pyx_DECREF(__pyx_v_self->_description); + __pyx_v_self->_description = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":420 + * def __init__(self, connection: TaosConnection=None) -> None: + * self._description = [] + * self._connection = connection # <<<<<<<<<<<<<< + * self._result = None + * + */ + __Pyx_INCREF((PyObject *)__pyx_v_connection); + __Pyx_GIVEREF((PyObject *)__pyx_v_connection); + __Pyx_GOTREF((PyObject *)__pyx_v_self->_connection); + __Pyx_DECREF((PyObject *)__pyx_v_self->_connection); + __pyx_v_self->_connection = __pyx_v_connection; + + /* "taos/_objects.pyx":421 + * self._description = [] + * self._connection = connection + * self._result = None # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF((PyObject *)__pyx_v_self->_result); + __Pyx_DECREF((PyObject *)__pyx_v_self->_result); + __pyx_v_self->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)Py_None); + + /* "taos/_objects.pyx":418 + * cdef TaosResult _result + * + * def __init__(self, connection: TaosConnection=None) -> None: # <<<<<<<<<<<<<< + * self._description = [] + * self._connection = connection + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosCursor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_4taos_8_objects_10TaosCursor_4generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "taos/_objects.pyx":423 + * self._result = None + * + * def __iter__(self): # <<<<<<<<<<<<<< + * for block, num_of_rows in self._result.blocks_iter(): + * for row in block: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_3__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_3__iter__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_2__iter__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_2__iter__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iter__", 0); + __pyx_cur_scope = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__(__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 423, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_self = __pyx_v_self; + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4taos_8_objects_10TaosCursor_4generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TaosCursor___iter, __pyx_n_s_taos__objects); if (unlikely(!gen)) __PYX_ERR(0, 423, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosCursor.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_4taos_8_objects_10TaosCursor_4generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + __Pyx_TraceCall("__iter__", __pyx_f[0], 423, 0, __PYX_ERR(0, 423, __pyx_L1_error)); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L10_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 423, __pyx_L1_error) + + /* "taos/_objects.pyx":424 + * + * def __iter__(self): + * for block, num_of_rows in self._result.blocks_iter(): # <<<<<<<<<<<<<< + * for row in block: + * yield row + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_result), __pyx_n_s_blocks_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 424, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 424, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_6(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 424, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 424, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_block); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_block, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_num_of_rows); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_num_of_rows, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "taos/_objects.pyx":425 + * def __iter__(self): + * for block, num_of_rows in self._result.blocks_iter(): + * for row in block: # <<<<<<<<<<<<<< + * yield row + * + */ + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_block)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_block)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_v_block; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_block); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 425, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 425, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 425, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_11(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 425, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + + /* "taos/_objects.pyx":426 + * for block, num_of_rows in self._result.blocks_iter(): + * for row in block: + * yield row # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_row); + __pyx_r = __pyx_cur_scope->__pyx_v_row; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __Pyx_XGIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_6; + __pyx_cur_scope->__pyx_t_4 = __pyx_t_10; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L10_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_10 = __pyx_cur_scope->__pyx_t_4; + __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 426, __pyx_L1_error) + + /* "taos/_objects.pyx":425 + * def __iter__(self): + * for block, num_of_rows in self._result.blocks_iter(): + * for row in block: # <<<<<<<<<<<<<< + * yield row + * + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_objects.pyx":424 + * + * def __iter__(self): + * for block, num_of_rows in self._result.blocks_iter(): # <<<<<<<<<<<<<< + * for row in block: + * yield row + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* "taos/_objects.pyx":423 + * self._result = None + * + * def __iter__(self): # <<<<<<<<<<<<<< + * for block, num_of_rows in self._result.blocks_iter(): + * for row in block: + */ + + /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":428 + * yield row + * + * @property # <<<<<<<<<<<<<< + * def description(self): + * return self._description + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_11description_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_11description_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_11description___get__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_11description___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 428, 0, __PYX_ERR(0, 428, __pyx_L1_error)); + + /* "taos/_objects.pyx":430 + * @property + * def description(self): + * return self._description # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_description); + __pyx_r = __pyx_v_self->_description; + goto __pyx_L0; + + /* "taos/_objects.pyx":428 + * yield row + * + * @property # <<<<<<<<<<<<<< + * def description(self): + * return self._description + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosCursor.description.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":432 + * return self._description + * + * @property # <<<<<<<<<<<<<< + * def rowcount(self): + * return self._result.row_count + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_8rowcount_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_8rowcount_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_8rowcount___get__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_8rowcount___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 432, 0, __PYX_ERR(0, 432, __pyx_L1_error)); + + /* "taos/_objects.pyx":434 + * @property + * def rowcount(self): + * return self._result.row_count # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_result), __pyx_n_s_row_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":432 + * return self._description + * + * @property # <<<<<<<<<<<<<< + * def rowcount(self): + * return self._result.row_count + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosCursor.rowcount.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":436 + * return self._result.row_count + * + * @property # <<<<<<<<<<<<<< + * def affected_rows(self): + * """Return the rowcount of insertion""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_13affected_rows_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_13affected_rows_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_13affected_rows___get__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_13affected_rows___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 436, 0, __PYX_ERR(0, 436, __pyx_L1_error)); + + /* "taos/_objects.pyx":439 + * def affected_rows(self): + * """Return the rowcount of insertion""" + * return self._result.affected_rows # <<<<<<<<<<<<<< + * + * def execute(self, sql, params=None, req_id: Optional[int] = None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_result), __pyx_n_s_affected_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":436 + * return self._result.row_count + * + * @property # <<<<<<<<<<<<<< + * def affected_rows(self): + * """Return the rowcount of insertion""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosCursor.affected_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":441 + * return self._result.affected_rows + * + * def execute(self, sql, params=None, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * """Prepare and execute a database operation (query or command).""" + * if not self._connection: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_6execute(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_5execute, "TaosCursor.execute(self, sql, params=None, int req_id: Optional[int] = None)\nPrepare and execute a database operation (query or command)."); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_6execute = {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_6execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_5execute}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_6execute(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_sql = 0; + CYTHON_UNUSED PyObject *__pyx_v_params = 0; + PyObject *__pyx_v_req_id = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sql,&__pyx_n_s_params,&__pyx_n_s_req_id,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject*)Py_None); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sql)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params); + if (value) { values[1] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_req_id); + if (value) { values[2] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "execute") < 0)) __PYX_ERR(0, 441, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_sql = values[0]; + __pyx_v_params = values[1]; + __pyx_v_req_id = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("execute", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 441, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosCursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_req_id), (&PyInt_Type), 1, "req_id", 1))) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_5execute(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self), __pyx_v_sql, __pyx_v_params, __pyx_v_req_id); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_5execute(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, PyObject *__pyx_v_sql, CYTHON_UNUSED PyObject *__pyx_v_params, PyObject *__pyx_v_req_id) { + PyObject *__pyx_8genexpr7__pyx_v_f = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__33) + __Pyx_RefNannySetupContext("execute", 0); + __Pyx_TraceCall("execute", __pyx_f[0], 441, 0, __PYX_ERR(0, 441, __pyx_L1_error)); + + /* "taos/_objects.pyx":443 + * def execute(self, sql, params=None, req_id: Optional[int] = None): + * """Prepare and execute a database operation (query or command).""" + * if not self._connection: # <<<<<<<<<<<<<< + * raise ProgrammingError("Cursor is not connected") + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->_connection)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_1); + if (unlikely(__pyx_t_2)) { + + /* "taos/_objects.pyx":444 + * """Prepare and execute a database operation (query or command).""" + * if not self._connection: + * raise ProgrammingError("Cursor is not connected") # <<<<<<<<<<<<<< + * + * self._reset_result() + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_Cursor_is_not_connected}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 444, __pyx_L1_error) + + /* "taos/_objects.pyx":443 + * def execute(self, sql, params=None, req_id: Optional[int] = None): + * """Prepare and execute a database operation (query or command).""" + * if not self._connection: # <<<<<<<<<<<<<< + * raise ProgrammingError("Cursor is not connected") + * + */ + } + + /* "taos/_objects.pyx":446 + * raise ProgrammingError("Cursor is not connected") + * + * self._reset_result() # <<<<<<<<<<<<<< + * + * self._result = self._connection.query(sql, req_id) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_5, }; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":448 + * self._reset_result() + * + * self._result = self._connection.query(sql, req_id) # <<<<<<<<<<<<<< + * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_connection), __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_sql, __pyx_v_req_id}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4taos_8_objects_TaosResult))))) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF((PyObject *)__pyx_v_self->_result); + __Pyx_DECREF((PyObject *)__pyx_v_self->_result); + __pyx_v_self->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "taos/_objects.pyx":449 + * + * self._result = self._connection.query(sql, req_id) + * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] # <<<<<<<<<<<<<< + * + * def fetchone(self): + */ + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_result), __pyx_n_s_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 449, __pyx_L6_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_5))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 449, __pyx_L6_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 449, __pyx_L6_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_8(__pyx_t_5); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 449, __pyx_L6_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_f, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_f, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_6 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_utf_8}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_f, __pyx_n_s_type_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_9, 3, Py_None); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_9, 4, Py_None); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_9, 5, Py_None); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + PyTuple_SET_ITEM(__pyx_t_9, 6, Py_False); + __pyx_t_4 = 0; + __pyx_t_10 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 449, __pyx_L6_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_f); __pyx_8genexpr7__pyx_v_f = 0; + goto __pyx_L10_exit_scope; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_f); __pyx_8genexpr7__pyx_v_f = 0; + goto __pyx_L1_error; + __pyx_L10_exit_scope:; + } /* exit inner scope */ + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_description); + __Pyx_DECREF(__pyx_v_self->_description); + __pyx_v_self->_description = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "taos/_objects.pyx":441 + * return self._result.affected_rows + * + * def execute(self, sql, params=None, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * """Prepare and execute a database operation (query or command).""" + * if not self._connection: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("taos._objects.TaosCursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_f); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":451 + * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] + * + * def fetchone(self): # <<<<<<<<<<<<<< + * return next(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_8fetchone(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_7fetchone, "TaosCursor.fetchone(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_8fetchone = {"fetchone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_8fetchone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_7fetchone}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_8fetchone(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchone (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("fetchone", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetchone", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_7fetchone(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_7fetchone(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__34) + __Pyx_RefNannySetupContext("fetchone", 0); + __Pyx_TraceCall("fetchone", __pyx_f[0], 451, 0, __PYX_ERR(0, 451, __pyx_L1_error)); + + /* "taos/_objects.pyx":452 + * + * def fetchone(self): + * return next(self) # <<<<<<<<<<<<<< + * + * def fetchall(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":451 + * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] + * + * def fetchone(self): # <<<<<<<<<<<<<< + * return next(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosCursor.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":454 + * return next(self) + * + * def fetchall(self): # <<<<<<<<<<<<<< + * return [r for r in self] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_10fetchall(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_9fetchall, "TaosCursor.fetchall(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_10fetchall = {"fetchall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_10fetchall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_9fetchall}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_10fetchall(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fetchall (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("fetchall", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetchall", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_9fetchall(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_9fetchall(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + PyObject *__pyx_8genexpr8__pyx_v_r = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__35) + __Pyx_RefNannySetupContext("fetchall", 0); + __Pyx_TraceCall("fetchall", __pyx_f[0], 454, 0, __PYX_ERR(0, 454, __pyx_L1_error)); + + /* "taos/_objects.pyx":455 + * + * def fetchall(self): + * return [r for r in self] # <<<<<<<<<<<<<< + * + * def close(self): + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) { + __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L5_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 455, __pyx_L5_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 455, __pyx_L5_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 455, __pyx_L5_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_r, __pyx_t_5); + __pyx_t_5 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr8__pyx_v_r))) __PYX_ERR(0, 455, __pyx_L5_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); __pyx_8genexpr8__pyx_v_r = 0; + goto __pyx_L9_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); __pyx_8genexpr8__pyx_v_r = 0; + goto __pyx_L1_error; + __pyx_L9_exit_scope:; + } /* exit inner scope */ + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":454 + * return next(self) + * + * def fetchall(self): # <<<<<<<<<<<<<< + * return [r for r in self] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("taos._objects.TaosCursor.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":457 + * return [r for r in self] + * + * def close(self): # <<<<<<<<<<<<<< + * if self._connection is None: + * return False + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_12close(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_11close, "TaosCursor.close(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_12close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_12close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_11close}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_12close(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_11close(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_11close(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__36) + __Pyx_RefNannySetupContext("close", 0); + __Pyx_TraceCall("close", __pyx_f[0], 457, 0, __PYX_ERR(0, 457, __pyx_L1_error)); + + /* "taos/_objects.pyx":458 + * + * def close(self): + * if self._connection is None: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_1 = (((PyObject *)__pyx_v_self->_connection) == Py_None); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":459 + * def close(self): + * if self._connection is None: + * return False # <<<<<<<<<<<<<< + * + * self._reset_result() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "taos/_objects.pyx":458 + * + * def close(self): + * if self._connection is None: # <<<<<<<<<<<<<< + * return False + * + */ + } + + /* "taos/_objects.pyx":461 + * return False + * + * self._reset_result() # <<<<<<<<<<<<<< + * self._connection = None + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_4, }; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":462 + * + * self._reset_result() + * self._connection = None # <<<<<<<<<<<<<< + * + * return True + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF((PyObject *)__pyx_v_self->_connection); + __Pyx_DECREF((PyObject *)__pyx_v_self->_connection); + __pyx_v_self->_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)Py_None); + + /* "taos/_objects.pyx":464 + * self._connection = None + * + * return True # <<<<<<<<<<<<<< + * + * def _reset_result(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "taos/_objects.pyx":457 + * return [r for r in self] + * + * def close(self): # <<<<<<<<<<<<<< + * if self._connection is None: + * return False + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("taos._objects.TaosCursor.close", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":466 + * return True + * + * def _reset_result(self): # <<<<<<<<<<<<<< + * """Reset the result to unused version.""" + * self._description = [] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_14_reset_result(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_13_reset_result, "TaosCursor._reset_result(self)\nReset the result to unused version."); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_14_reset_result = {"_reset_result", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_14_reset_result, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_13_reset_result}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_14_reset_result(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_reset_result (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("_reset_result", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_reset_result", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_13_reset_result(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_13_reset_result(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__37) + __Pyx_RefNannySetupContext("_reset_result", 0); + __Pyx_TraceCall("_reset_result", __pyx_f[0], 466, 0, __PYX_ERR(0, 466, __pyx_L1_error)); + + /* "taos/_objects.pyx":468 + * def _reset_result(self): + * """Reset the result to unused version.""" + * self._description = [] # <<<<<<<<<<<<<< + * self._result = None + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_description); + __Pyx_DECREF(__pyx_v_self->_description); + __pyx_v_self->_description = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":469 + * """Reset the result to unused version.""" + * self._description = [] + * self._result = None # <<<<<<<<<<<<<< + * + * def __del__(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF((PyObject *)__pyx_v_self->_result); + __Pyx_DECREF((PyObject *)__pyx_v_self->_result); + __pyx_v_self->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)Py_None); + + /* "taos/_objects.pyx":466 + * return True + * + * def _reset_result(self): # <<<<<<<<<<<<<< + * """Reset the result to unused version.""" + * self._description = [] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosCursor._reset_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":471 + * self._result = None + * + * def __del__(self): # <<<<<<<<<<<<<< + * self.close() + * + */ + +/* Python wrapper */ +static void __pyx_pw_4taos_8_objects_10TaosCursor_16__del__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_4taos_8_objects_10TaosCursor_16__del__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_pf_4taos_8_objects_10TaosCursor_15__del__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_4taos_8_objects_10TaosCursor_15__del__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_TraceCall("__del__", __pyx_f[0], 471, 0, __PYX_ERR(0, 471, __pyx_L1_error)); + + /* "taos/_objects.pyx":472 + * + * def __del__(self): + * self.close() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + { + PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_objects.pyx":471 + * self._result = None + * + * def __del__(self): # <<<<<<<<<<<<<< + * self.close() + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("taos._objects.TaosCursor.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_18__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_17__reduce_cython__, "TaosCursor.__reduce_cython__(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_18__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_18__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_17__reduce_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_18__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_17__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_17__reduce_cython__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { + PyObject *__pyx_v_state = 0; + PyObject *__pyx_v__dict = 0; + int __pyx_v_use_setstate; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__38) + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":5 + * cdef object _dict + * cdef bint use_setstate + * state = (self._connection, self._description, self._result) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF((PyObject *)__pyx_v_self->_connection); + __Pyx_GIVEREF((PyObject *)__pyx_v_self->_connection); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->_connection)); + __Pyx_INCREF(__pyx_v_self->_description); + __Pyx_GIVEREF(__pyx_v_self->_description); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_description); + __Pyx_INCREF((PyObject *)__pyx_v_self->_result); + __Pyx_GIVEREF((PyObject *)__pyx_v_self->_result); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->_result)); + __pyx_v_state = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":6 + * cdef bint use_setstate + * state = (self._connection, self._description, self._result) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":7 + * state = (self._connection, self._description, self._result) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + if (__pyx_t_2) { + + /* "(tree fragment)":8 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "(tree fragment)":9 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self._connection is not None or self._description is not None or self._result is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":7 + * state = (self._connection, self._description, self._result) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":11 + * use_setstate = True + * else: + * use_setstate = self._connection is not None or self._description is not None or self._result is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state + */ + /*else*/ { + __pyx_t_4 = (((PyObject *)__pyx_v_self->_connection) != Py_None); + if (!__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = (__pyx_v_self->_description != ((PyObject*)Py_None)); + if (!__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = (((PyObject *)__pyx_v_self->_result) != Py_None); + __pyx_t_2 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + __pyx_v_use_setstate = __pyx_t_2; + } + __pyx_L3:; + + /* "(tree fragment)":12 + * else: + * use_setstate = self._connection is not None or self._description is not None or self._result is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state + * else: + */ + if (__pyx_v_use_setstate) { + + /* "(tree fragment)":13 + * use_setstate = self._connection is not None or self._description is not None or self._result is not None + * if use_setstate: + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_TaosCursor); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_126557407); + __Pyx_GIVEREF(__pyx_int_126557407); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_126557407); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":12 + * else: + * use_setstate = self._connection is not None or self._description is not None or self._result is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state + * else: + */ + } + + /* "(tree fragment)":15 + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state + * else: + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_TaosCursor); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_126557407); + __Pyx_GIVEREF(__pyx_int_126557407); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_126557407); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("taos._objects.TaosCursor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":16 + * else: + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_20__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_19__setstate_cython__, "TaosCursor.__setstate_cython__(self, __pyx_state)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_20__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_20__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_19__setstate_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_20__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v___pyx_state = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v___pyx_state = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosCursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_19__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self), __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_19__setstate_cython__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__39) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); + + /* "(tree fragment)":17 + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4taos_8_objects___pyx_unpickle_TaosCursor__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosCursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":481 + * cdef int64_t _end + * + * def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): # <<<<<<<<<<<<<< + * self._vg_id = vg_id + * self._current_offset = current_offset + */ + +/* Python wrapper */ +static int __pyx_pw_4taos_8_objects_19TaosTopicAssignment_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_4taos_8_objects_19TaosTopicAssignment_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int32_t __pyx_v_vg_id; + int64_t __pyx_v_current_offset; + int64_t __pyx_v_begin; + int64_t __pyx_v_end; + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vg_id,&__pyx_n_s_current_offset,&__pyx_n_s_begin,&__pyx_n_s_end,0}; + PyObject* values[4] = {0,0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_current_offset)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); __PYX_ERR(0, 481, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); __PYX_ERR(0, 481, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); __PYX_ERR(0, 481, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 481, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); + values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); + values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); + } + __pyx_v_vg_id = __Pyx_PyInt_As_int32_t(values[0]); if (unlikely((__pyx_v_vg_id == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) + __pyx_v_current_offset = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_current_offset == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) + __pyx_v_begin = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_begin == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) + __pyx_v_end = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_end == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment___cinit__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self), __pyx_v_vg_id, __pyx_v_current_offset, __pyx_v_begin, __pyx_v_end); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_4taos_8_objects_19TaosTopicAssignment___cinit__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self, int32_t __pyx_v_vg_id, int64_t __pyx_v_current_offset, int64_t __pyx_v_begin, int64_t __pyx_v_end) { + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_TraceCall("__cinit__", __pyx_f[0], 481, 0, __PYX_ERR(0, 481, __pyx_L1_error)); + + /* "taos/_objects.pyx":482 + * + * def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): + * self._vg_id = vg_id # <<<<<<<<<<<<<< + * self._current_offset = current_offset + * self._begin = begin + */ + __pyx_v_self->_vg_id = __pyx_v_vg_id; + + /* "taos/_objects.pyx":483 + * def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): + * self._vg_id = vg_id + * self._current_offset = current_offset # <<<<<<<<<<<<<< + * self._begin = begin + * self._end = end + */ + __pyx_v_self->_current_offset = __pyx_v_current_offset; + + /* "taos/_objects.pyx":484 + * self._vg_id = vg_id + * self._current_offset = current_offset + * self._begin = begin # <<<<<<<<<<<<<< + * self._end = end + * + */ + __pyx_v_self->_begin = __pyx_v_begin; + + /* "taos/_objects.pyx":485 + * self._current_offset = current_offset + * self._begin = begin + * self._end = end # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_v_self->_end = __pyx_v_end; + + /* "taos/_objects.pyx":481 + * cdef int64_t _end + * + * def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): # <<<<<<<<<<<<<< + * self._vg_id = vg_id + * self._current_offset = current_offset + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":487 + * self._end = end + * + * @property # <<<<<<<<<<<<<< + * def vg_id(self): + * return self._vg_id + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5vg_id_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5vg_id_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_5vg_id___get__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_5vg_id___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 487, 0, __PYX_ERR(0, 487, __pyx_L1_error)); + + /* "taos/_objects.pyx":489 + * @property + * def vg_id(self): + * return self._vg_id # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_vg_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":487 + * self._end = end + * + * @property # <<<<<<<<<<<<<< + * def vg_id(self): + * return self._vg_id + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.vg_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":491 + * return self._vg_id + * + * @property # <<<<<<<<<<<<<< + * def current_offset(self): + * return self._current_offset + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_14current_offset_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_14current_offset_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_14current_offset___get__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_14current_offset___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 491, 0, __PYX_ERR(0, 491, __pyx_L1_error)); + + /* "taos/_objects.pyx":493 + * @property + * def current_offset(self): + * return self._current_offset # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_current_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":491 + * return self._vg_id + * + * @property # <<<<<<<<<<<<<< + * def current_offset(self): + * return self._current_offset + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.current_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":495 + * return self._current_offset + * + * @property # <<<<<<<<<<<<<< + * def begin(self): + * return self._begin + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5begin_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5begin_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_5begin___get__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_5begin___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 495, 0, __PYX_ERR(0, 495, __pyx_L1_error)); + + /* "taos/_objects.pyx":497 + * @property + * def begin(self): + * return self._begin # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":495 + * return self._current_offset + * + * @property # <<<<<<<<<<<<<< + * def begin(self): + * return self._begin + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.begin.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":499 + * return self._begin + * + * @property # <<<<<<<<<<<<<< + * def end(self): + * return self._end + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3end_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3end_1__get__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_3end___get__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_3end___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_TraceCall("__get__", __pyx_f[0], 499, 0, __PYX_ERR(0, 499, __pyx_L1_error)); + + /* "taos/_objects.pyx":501 + * @property + * def end(self): + * return self._end # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":499 + * return self._begin + * + * @property # <<<<<<<<<<<<<< + * def end(self): + * return self._end + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__, "TaosTopicAssignment.__reduce_cython__(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__40) + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__, "TaosTopicAssignment.__setstate_cython__(self, __pyx_state)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v___pyx_state = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self), __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__41) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); + + /* "(tree fragment)":4 + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":509 + * cdef tmq_t *_tmq + * + * def __cinit__(self, configs: dict[str, str]): # <<<<<<<<<<<<<< + * self._configs = configs + * self._tmq_conf = tmq_conf_new() + */ + +/* Python wrapper */ +static int __pyx_pw_4taos_8_objects_12TaosConsumer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_4taos_8_objects_12TaosConsumer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_configs = 0; + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_configs,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_configs)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 509, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + } + __pyx_v_configs = ((PyObject*)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 509, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_configs), (&PyDict_Type), 0, "configs", 1))) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer___cinit__(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_configs); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_4taos_8_objects_12TaosConsumer___cinit__(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_configs) { + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_v__k = NULL; + PyObject *__pyx_v__v = NULL; + tmq_conf_res_t __pyx_v_tmq_conf_res; + int __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + char const *__pyx_t_9; + char const *__pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_TraceCall("__cinit__", __pyx_f[0], 509, 0, __PYX_ERR(0, 509, __pyx_L1_error)); + + /* "taos/_objects.pyx":510 + * + * def __cinit__(self, configs: dict[str, str]): + * self._configs = configs # <<<<<<<<<<<<<< + * self._tmq_conf = tmq_conf_new() + * for k, v in self._configs.items(): + */ + __Pyx_INCREF(__pyx_v_configs); + __Pyx_GIVEREF(__pyx_v_configs); + __Pyx_GOTREF(__pyx_v_self->_configs); + __Pyx_DECREF(__pyx_v_self->_configs); + __pyx_v_self->_configs = __pyx_v_configs; + + /* "taos/_objects.pyx":511 + * def __cinit__(self, configs: dict[str, str]): + * self._configs = configs + * self._tmq_conf = tmq_conf_new() # <<<<<<<<<<<<<< + * for k, v in self._configs.items(): + * _k = k.encode("utf-8") + */ + __pyx_v_self->_tmq_conf = tmq_conf_new(); + + /* "taos/_objects.pyx":512 + * self._configs = configs + * self._tmq_conf = tmq_conf_new() + * for k, v in self._configs.items(): # <<<<<<<<<<<<<< + * _k = k.encode("utf-8") + * _v = v.encode("utf-8") + */ + __pyx_t_2 = 0; + if (unlikely(__pyx_v_self->_configs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); + __PYX_ERR(0, 512, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->_configs, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); + __pyx_t_6 = 0; + + /* "taos/_objects.pyx":513 + * self._tmq_conf = tmq_conf_new() + * for k, v in self._configs.items(): + * _k = k.encode("utf-8") # <<<<<<<<<<<<<< + * _v = v.encode("utf-8") + * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u_utf_8}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF_SET(__pyx_v__k, __pyx_t_6); + __pyx_t_6 = 0; + + /* "taos/_objects.pyx":514 + * for k, v in self._configs.items(): + * _k = k.encode("utf-8") + * _v = v.encode("utf-8") # <<<<<<<<<<<<<< + * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) + * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u_utf_8}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF_SET(__pyx_v__v, __pyx_t_6); + __pyx_t_6 = 0; + + /* "taos/_objects.pyx":515 + * _k = k.encode("utf-8") + * _v = v.encode("utf-8") + * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) # <<<<<<<<<<<<<< + * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: + * tmq_conf_destroy(self._tmq_conf) + */ + __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v__k); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v__v); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_v_tmq_conf_res = tmq_conf_set(__pyx_v_self->_tmq_conf, __pyx_t_9, __pyx_t_10); + + /* "taos/_objects.pyx":516 + * _v = v.encode("utf-8") + * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) + * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: # <<<<<<<<<<<<<< + * tmq_conf_destroy(self._tmq_conf) + * self._tmq_conf = NULL + */ + __pyx_t_11 = (__pyx_v_tmq_conf_res != TMQ_CONF_OK); + if (unlikely(__pyx_t_11)) { + + /* "taos/_objects.pyx":517 + * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) + * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: + * tmq_conf_destroy(self._tmq_conf) # <<<<<<<<<<<<<< + * self._tmq_conf = NULL + * raise Exception("set up tmq config failed!") + */ + tmq_conf_destroy(__pyx_v_self->_tmq_conf); + + /* "taos/_objects.pyx":518 + * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: + * tmq_conf_destroy(self._tmq_conf) + * self._tmq_conf = NULL # <<<<<<<<<<<<<< + * raise Exception("set up tmq config failed!") + * + */ + __pyx_v_self->_tmq_conf = NULL; + + /* "taos/_objects.pyx":519 + * tmq_conf_destroy(self._tmq_conf) + * self._tmq_conf = NULL + * raise Exception("set up tmq config failed!") # <<<<<<<<<<<<<< + * + * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) + */ + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(0, 519, __pyx_L1_error) + + /* "taos/_objects.pyx":516 + * _v = v.encode("utf-8") + * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) + * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: # <<<<<<<<<<<<<< + * tmq_conf_destroy(self._tmq_conf) + * self._tmq_conf = NULL + */ + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_objects.pyx":521 + * raise Exception("set up tmq config failed!") + * + * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) # <<<<<<<<<<<<<< + * if self._tmq is NULL: + * raise Exception("setup tmq failed") + */ + __pyx_v_self->_tmq = tmq_consumer_new(__pyx_v_self->_tmq_conf, NULL, 0); + + /* "taos/_objects.pyx":522 + * + * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) + * if self._tmq is NULL: # <<<<<<<<<<<<<< + * raise Exception("setup tmq failed") + * + */ + __pyx_t_11 = (__pyx_v_self->_tmq == NULL); + if (unlikely(__pyx_t_11)) { + + /* "taos/_objects.pyx":523 + * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) + * if self._tmq is NULL: + * raise Exception("setup tmq failed") # <<<<<<<<<<<<<< + * + * def subscribe(self, topics: list[str]): + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 523, __pyx_L1_error) + + /* "taos/_objects.pyx":522 + * + * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) + * if self._tmq is NULL: # <<<<<<<<<<<<<< + * raise Exception("setup tmq failed") + * + */ + } + + /* "taos/_objects.pyx":509 + * cdef tmq_t *_tmq + * + * def __cinit__(self, configs: dict[str, str]): # <<<<<<<<<<<<<< + * self._configs = configs + * self._tmq_conf = tmq_conf_new() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("taos._objects.TaosConsumer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XDECREF(__pyx_v__k); + __Pyx_XDECREF(__pyx_v__v); + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":525 + * raise Exception("setup tmq failed") + * + * def subscribe(self, topics: list[str]): # <<<<<<<<<<<<<< + * tmq_list = tmq_list_new() + * if tmq_list is NULL: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_3subscribe(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_2subscribe, "TaosConsumer.subscribe(self, list topics: list[str])"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_3subscribe = {"subscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_3subscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_2subscribe}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_3subscribe(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_topics = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("subscribe (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topics,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topics)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "subscribe") < 0)) __PYX_ERR(0, 525, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_topics = ((PyObject*)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("subscribe", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 525, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.subscribe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topics), (&PyList_Type), 0, "topics", 1))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_2subscribe(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topics); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_2subscribe(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topics) { + tmq_list_t *__pyx_v_tmq_list; + PyObject *__pyx_v_tp = NULL; + PyObject *__pyx_v__tp = NULL; + int32_t __pyx_v_tmq_errno; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__44) + __Pyx_RefNannySetupContext("subscribe", 0); + __Pyx_TraceCall("subscribe", __pyx_f[0], 525, 0, __PYX_ERR(0, 525, __pyx_L1_error)); + + /* "taos/_objects.pyx":526 + * + * def subscribe(self, topics: list[str]): + * tmq_list = tmq_list_new() # <<<<<<<<<<<<<< + * if tmq_list is NULL: + * raise Exception("set up tmq list failed!") + */ + __pyx_v_tmq_list = tmq_list_new(); + + /* "taos/_objects.pyx":527 + * def subscribe(self, topics: list[str]): + * tmq_list = tmq_list_new() + * if tmq_list is NULL: # <<<<<<<<<<<<<< + * raise Exception("set up tmq list failed!") + * + */ + __pyx_t_1 = (__pyx_v_tmq_list == NULL); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":528 + * tmq_list = tmq_list_new() + * if tmq_list is NULL: + * raise Exception("set up tmq list failed!") # <<<<<<<<<<<<<< + * + * for tp in topics: + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 528, __pyx_L1_error) + + /* "taos/_objects.pyx":527 + * def subscribe(self, topics: list[str]): + * tmq_list = tmq_list_new() + * if tmq_list is NULL: # <<<<<<<<<<<<<< + * raise Exception("set up tmq list failed!") + * + */ + } + + /* "taos/_objects.pyx":530 + * raise Exception("set up tmq list failed!") + * + * for tp in topics: # <<<<<<<<<<<<<< + * _tp = tp.encode("utf-8") + * tmq_errno = tmq_list_append(tmq_list, _tp) + */ + __pyx_t_2 = __pyx_v_topics; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + for (;;) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 530, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XDECREF_SET(__pyx_v_tp, __pyx_t_4); + __pyx_t_4 = 0; + + /* "taos/_objects.pyx":531 + * + * for tp in topics: + * _tp = tp.encode("utf-8") # <<<<<<<<<<<<<< + * tmq_errno = tmq_list_append(tmq_list, _tp) + * if tmq_errno != 0: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tp, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_utf_8}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF_SET(__pyx_v__tp, __pyx_t_4); + __pyx_t_4 = 0; + + /* "taos/_objects.pyx":532 + * for tp in topics: + * _tp = tp.encode("utf-8") + * tmq_errno = tmq_list_append(tmq_list, _tp) # <<<<<<<<<<<<<< + * if tmq_errno != 0: + * tmq_list_destroy(tmq_list) + */ + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v__tp); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_v_tmq_errno = tmq_list_append(__pyx_v_tmq_list, __pyx_t_8); + + /* "taos/_objects.pyx":533 + * _tp = tp.encode("utf-8") + * tmq_errno = tmq_list_append(tmq_list, _tp) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * tmq_list_destroy(tmq_list) + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + __pyx_t_1 = (__pyx_v_tmq_errno != 0); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":534 + * tmq_errno = tmq_list_append(tmq_list, _tp) + * if tmq_errno != 0: + * tmq_list_destroy(tmq_list) # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + tmq_list_destroy(__pyx_v_tmq_list); + + /* "taos/_objects.pyx":535 + * if tmq_errno != 0: + * tmq_list_destroy(tmq_list) + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< + * + * tmq_errno = tmq_subscribe(self._tmq, tmq_list) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_6, __pyx_t_9}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 535, __pyx_L1_error) + + /* "taos/_objects.pyx":533 + * _tp = tp.encode("utf-8") + * tmq_errno = tmq_list_append(tmq_list, _tp) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * tmq_list_destroy(tmq_list) + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + } + + /* "taos/_objects.pyx":530 + * raise Exception("set up tmq list failed!") + * + * for tp in topics: # <<<<<<<<<<<<<< + * _tp = tp.encode("utf-8") + * tmq_errno = tmq_list_append(tmq_list, _tp) + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":537 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * tmq_errno = tmq_subscribe(self._tmq, tmq_list) # <<<<<<<<<<<<<< + * if tmq_errno != 0: + * tmq_list_destroy(tmq_list) + */ + __pyx_v_tmq_errno = tmq_subscribe(__pyx_v_self->_tmq, __pyx_v_tmq_list); + + /* "taos/_objects.pyx":538 + * + * tmq_errno = tmq_subscribe(self._tmq, tmq_list) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * tmq_list_destroy(tmq_list) + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + __pyx_t_1 = (__pyx_v_tmq_errno != 0); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":539 + * tmq_errno = tmq_subscribe(self._tmq, tmq_list) + * if tmq_errno != 0: + * tmq_list_destroy(tmq_list) # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + tmq_list_destroy(__pyx_v_tmq_list); + + /* "taos/_objects.pyx":540 + * if tmq_errno != 0: + * tmq_list_destroy(tmq_list) + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< + * + * def unsubscribe(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_9}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 540, __pyx_L1_error) + + /* "taos/_objects.pyx":538 + * + * tmq_errno = tmq_subscribe(self._tmq, tmq_list) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * tmq_list_destroy(tmq_list) + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + } + + /* "taos/_objects.pyx":525 + * raise Exception("setup tmq failed") + * + * def subscribe(self, topics: list[str]): # <<<<<<<<<<<<<< + * tmq_list = tmq_list_new() + * if tmq_list is NULL: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("taos._objects.TaosConsumer.subscribe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tp); + __Pyx_XDECREF(__pyx_v__tp); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":542 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def unsubscribe(self): # <<<<<<<<<<<<<< + * tmq_errno = tmq_unsubscribe(self._tmq) + * if tmq_errno != 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_5unsubscribe(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_4unsubscribe, "TaosConsumer.unsubscribe(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_5unsubscribe = {"unsubscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_5unsubscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_4unsubscribe}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_5unsubscribe(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unsubscribe (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("unsubscribe", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "unsubscribe", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_4unsubscribe(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_4unsubscribe(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self) { + int32_t __pyx_v_tmq_errno; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__46) + __Pyx_RefNannySetupContext("unsubscribe", 0); + __Pyx_TraceCall("unsubscribe", __pyx_f[0], 542, 0, __PYX_ERR(0, 542, __pyx_L1_error)); + + /* "taos/_objects.pyx":543 + * + * def unsubscribe(self): + * tmq_errno = tmq_unsubscribe(self._tmq) # <<<<<<<<<<<<<< + * if tmq_errno != 0: + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + __pyx_v_tmq_errno = tmq_unsubscribe(__pyx_v_self->_tmq); + + /* "taos/_objects.pyx":544 + * def unsubscribe(self): + * tmq_errno = tmq_unsubscribe(self._tmq) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + __pyx_t_1 = (__pyx_v_tmq_errno != 0); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":545 + * tmq_errno = tmq_unsubscribe(self._tmq) + * if tmq_errno != 0: + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< + * + * def poll(self, timeout: int): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 545, __pyx_L1_error) + + /* "taos/_objects.pyx":544 + * def unsubscribe(self): + * tmq_errno = tmq_unsubscribe(self._tmq) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + } + + /* "taos/_objects.pyx":542 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def unsubscribe(self): # <<<<<<<<<<<<<< + * tmq_errno = tmq_unsubscribe(self._tmq) + * if tmq_errno != 0: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("taos._objects.TaosConsumer.unsubscribe", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":547 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def poll(self, timeout: int): # <<<<<<<<<<<<<< + * res = tmq_consumer_poll(self._tmq, timeout) + * if res is NULL: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_7poll(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_6poll, "TaosConsumer.poll(self, int timeout: int)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_7poll = {"poll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_7poll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_6poll}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_7poll(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_timeout = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("poll (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "poll") < 0)) __PYX_ERR(0, 547, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_timeout = ((PyObject*)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("poll", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 547, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_timeout), (&PyInt_Type), 0, "timeout", 1))) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_6poll(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_6poll(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_timeout) { + TAOS_RES *__pyx_v_res; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int64_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__47) + __Pyx_RefNannySetupContext("poll", 0); + __Pyx_TraceCall("poll", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error)); + + /* "taos/_objects.pyx":548 + * + * def poll(self, timeout: int): + * res = tmq_consumer_poll(self._tmq, timeout) # <<<<<<<<<<<<<< + * if res is NULL: + * return None + */ + __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_timeout); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_v_res = tmq_consumer_poll(__pyx_v_self->_tmq, __pyx_t_1); + + /* "taos/_objects.pyx":549 + * def poll(self, timeout: int): + * res = tmq_consumer_poll(self._tmq, timeout) + * if res is NULL: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_2 = (__pyx_v_res == NULL); + if (__pyx_t_2) { + + /* "taos/_objects.pyx":550 + * res = tmq_consumer_poll(self._tmq, timeout) + * if res is NULL: + * return None # <<<<<<<<<<<<<< + * + * return TaosResult(res) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "taos/_objects.pyx":549 + * def poll(self, timeout: int): + * res = tmq_consumer_poll(self._tmq, timeout) + * if res is NULL: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "taos/_objects.pyx":552 + * return None + * + * return TaosResult(res) # <<<<<<<<<<<<<< + * + * def commit(self, taos_res: TaosResult): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_res)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":547 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def poll(self, timeout: int): # <<<<<<<<<<<<<< + * res = tmq_consumer_poll(self._tmq, timeout) + * if res is NULL: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("taos._objects.TaosConsumer.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":554 + * return TaosResult(res) + * + * def commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * self.result_commit(taos_res) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_9commit(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_8commit, "TaosConsumer.commit(self, TaosResult taos_res: TaosResult)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_9commit = {"commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_9commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_8commit}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_9commit(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("commit (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "commit") < 0)) __PYX_ERR(0, 554, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("commit", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 554, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.commit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_8commit(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_8commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__48) + __Pyx_RefNannySetupContext("commit", 0); + __Pyx_TraceCall("commit", __pyx_f[0], 554, 0, __PYX_ERR(0, 554, __pyx_L1_error)); + + /* "taos/_objects.pyx":555 + * + * def commit(self, taos_res: TaosResult): + * self.result_commit(taos_res) # <<<<<<<<<<<<<< + * + * def result_commit(self, taos_res: TaosResult): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_result_commit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_taos_res)}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_objects.pyx":554 + * return TaosResult(res) + * + * def commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * self.result_commit(taos_res) + * + */ + + /* 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("taos._objects.TaosConsumer.commit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":557 + * self.result_commit(taos_res) + * + * def result_commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) + * if tmq_errno != 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_11result_commit(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_10result_commit, "TaosConsumer.result_commit(self, TaosResult taos_res: TaosResult)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_11result_commit = {"result_commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_11result_commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_10result_commit}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_11result_commit(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("result_commit (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 557, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "result_commit") < 0)) __PYX_ERR(0, 557, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("result_commit", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 557, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.result_commit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_10result_commit(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_10result_commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { + int32_t __pyx_v_tmq_errno; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__49) + __Pyx_RefNannySetupContext("result_commit", 0); + __Pyx_TraceCall("result_commit", __pyx_f[0], 557, 0, __PYX_ERR(0, 557, __pyx_L1_error)); + + /* "taos/_objects.pyx":558 + * + * def result_commit(self, taos_res: TaosResult): + * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) # <<<<<<<<<<<<<< + * if tmq_errno != 0: + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + __pyx_v_tmq_errno = tmq_commit_sync(__pyx_v_self->_tmq, __pyx_v_taos_res->_res); + + /* "taos/_objects.pyx":559 + * def result_commit(self, taos_res: TaosResult): + * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + __pyx_t_1 = (__pyx_v_tmq_errno != 0); + if (unlikely(__pyx_t_1)) { + + /* "taos/_objects.pyx":560 + * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) + * if tmq_errno != 0: + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< + * + * def offset_commit(self, topic: str, vg_id: int, offset: int): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 560, __pyx_L1_error) + + /* "taos/_objects.pyx":559 + * def result_commit(self, taos_res: TaosResult): + * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + } + + /* "taos/_objects.pyx":557 + * self.result_commit(taos_res) + * + * def result_commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) + * if tmq_errno != 0: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("taos._objects.TaosConsumer.result_commit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":562 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def offset_commit(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_13offset_commit(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_12offset_commit, "TaosConsumer.offset_commit(self, unicode topic: str, int vg_id: int, int offset: int)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_13offset_commit = {"offset_commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_13offset_commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_12offset_commit}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_13offset_commit(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_topic = 0; + PyObject *__pyx_v_vg_id = 0; + PyObject *__pyx_v_offset = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("offset_commit (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,&__pyx_n_s_vg_id,&__pyx_n_s_offset,0}; + PyObject* values[3] = {0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("offset_commit", 1, 3, 3, 1); __PYX_ERR(0, 562, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("offset_commit", 1, 3, 3, 2); __PYX_ERR(0, 562, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "offset_commit") < 0)) __PYX_ERR(0, 562, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_topic = ((PyObject*)values[0]); + __pyx_v_vg_id = ((PyObject*)values[1]); + __pyx_v_offset = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("offset_commit", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 562, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.offset_commit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 562, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg_id), (&PyInt_Type), 0, "vg_id", 1))) __PYX_ERR(0, 562, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_offset), (&PyInt_Type), 0, "offset", 1))) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_12offset_commit(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic, __pyx_v_vg_id, __pyx_v_offset); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_12offset_commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id, PyObject *__pyx_v_offset) { + PyObject *__pyx_v__topic = NULL; + int32_t __pyx_v_tmq_errno; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + int32_t __pyx_t_3; + int64_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__50) + __Pyx_RefNannySetupContext("offset_commit", 0); + __Pyx_TraceCall("offset_commit", __pyx_f[0], 562, 0, __PYX_ERR(0, 562, __pyx_L1_error)); + + /* "taos/_objects.pyx":563 + * + * def offset_commit(self, topic: str, vg_id: int, offset: int): + * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< + * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + * if tmq_errno != 0: + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__topic = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":564 + * def offset_commit(self, topic: str, vg_id: int, offset: int): + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) # <<<<<<<<<<<<<< + * if tmq_errno != 0: + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_vg_id); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_v_tmq_errno = tmq_commit_offset_sync(__pyx_v_self->_tmq, __pyx_t_2, __pyx_t_3, __pyx_t_4); + + /* "taos/_objects.pyx":565 + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + __pyx_t_5 = (__pyx_v_tmq_errno != 0); + if (unlikely(__pyx_t_5)) { + + /* "taos/_objects.pyx":566 + * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + * if tmq_errno != 0: + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< + * + * def get_topic_assignment(self, topic: str): + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_10 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 566, __pyx_L1_error) + + /* "taos/_objects.pyx":565 + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + } + + /* "taos/_objects.pyx":562 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def offset_commit(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("taos._objects.TaosConsumer.offset_commit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__topic); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":568 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def get_topic_assignment(self, topic: str): # <<<<<<<<<<<<<< + * cdef int32_t num_of_assignment + * cdef tmq_topic_assignment *assignment_ptr = NULL + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_15get_topic_assignment(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_14get_topic_assignment, "TaosConsumer.get_topic_assignment(self, unicode topic: str)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_15get_topic_assignment = {"get_topic_assignment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_15get_topic_assignment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_14get_topic_assignment}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_15get_topic_assignment(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_topic = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_topic_assignment (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_topic_assignment") < 0)) __PYX_ERR(0, 568, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_topic = ((PyObject*)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_topic_assignment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 568, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_topic_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_14get_topic_assignment(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_14get_topic_assignment(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic) { + int32_t __pyx_v_num_of_assignment; + tmq_topic_assignment *__pyx_v_assignment_ptr; + PyObject *__pyx_v__topic = NULL; + int32_t __pyx_v_tmq_errno; + tmq_topic_assignment *__pyx_v_assignment; + PyObject *__pyx_v_topic_assignments = NULL; + int32_t __pyx_v_i; + struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_tta = NULL; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int32_t __pyx_t_9; + int32_t __pyx_t_10; + int32_t __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__51) + __Pyx_RefNannySetupContext("get_topic_assignment", 0); + __Pyx_TraceCall("get_topic_assignment", __pyx_f[0], 568, 0, __PYX_ERR(0, 568, __pyx_L1_error)); + + /* "taos/_objects.pyx":570 + * def get_topic_assignment(self, topic: str): + * cdef int32_t num_of_assignment + * cdef tmq_topic_assignment *assignment_ptr = NULL # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) + */ + __pyx_v_assignment_ptr = NULL; + + /* "taos/_objects.pyx":571 + * cdef int32_t num_of_assignment + * cdef tmq_topic_assignment *assignment_ptr = NULL + * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< + * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) + * if tmq_errno != 0: + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__topic = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":572 + * cdef tmq_topic_assignment *assignment_ptr = NULL + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) # <<<<<<<<<<<<<< + * if tmq_errno != 0: + * tmq_free_assignment(assignment_ptr) + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_v_tmq_errno = tmq_get_topic_assignment(__pyx_v_self->_tmq, __pyx_t_2, (&__pyx_v_assignment_ptr), (&__pyx_v_num_of_assignment)); + + /* "taos/_objects.pyx":573 + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * tmq_free_assignment(assignment_ptr) + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + __pyx_t_3 = (__pyx_v_tmq_errno != 0); + if (unlikely(__pyx_t_3)) { + + /* "taos/_objects.pyx":574 + * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) + * if tmq_errno != 0: + * tmq_free_assignment(assignment_ptr) # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + tmq_free_assignment(__pyx_v_assignment_ptr); + + /* "taos/_objects.pyx":575 + * if tmq_errno != 0: + * tmq_free_assignment(assignment_ptr) + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< + * + * cdef tmq_topic_assignment *assignment + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 575, __pyx_L1_error) + + /* "taos/_objects.pyx":573 + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * tmq_free_assignment(assignment_ptr) + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + } + + /* "taos/_objects.pyx":578 + * + * cdef tmq_topic_assignment *assignment + * topic_assignments = [] # <<<<<<<<<<<<<< + * for i in range(num_of_assignment): + * assignment = &assignment_ptr[i] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_topic_assignments = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":579 + * cdef tmq_topic_assignment *assignment + * topic_assignments = [] + * for i in range(num_of_assignment): # <<<<<<<<<<<<<< + * assignment = &assignment_ptr[i] + * tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) + */ + __pyx_t_9 = __pyx_v_num_of_assignment; + __pyx_t_10 = __pyx_t_9; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "taos/_objects.pyx":580 + * topic_assignments = [] + * for i in range(num_of_assignment): + * assignment = &assignment_ptr[i] # <<<<<<<<<<<<<< + * tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) + * topic_assignments.append(tta) + */ + __pyx_v_assignment = (&(__pyx_v_assignment_ptr[__pyx_v_i])); + + /* "taos/_objects.pyx":581 + * for i in range(num_of_assignment): + * assignment = &assignment_ptr[i] + * tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) # <<<<<<<<<<<<<< + * topic_assignments.append(tta) + * + */ + __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_assignment->vgId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_assignment->currentOffset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_assignment->begin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_assignment->end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4taos_8_objects_TaosTopicAssignment), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_tta, ((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "taos/_objects.pyx":582 + * assignment = &assignment_ptr[i] + * tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) + * topic_assignments.append(tta) # <<<<<<<<<<<<<< + * + * tmq_free_assignment(assignment_ptr) + */ + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_topic_assignments, ((PyObject *)__pyx_v_tta)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 582, __pyx_L1_error) + } + + /* "taos/_objects.pyx":584 + * topic_assignments.append(tta) + * + * tmq_free_assignment(assignment_ptr) # <<<<<<<<<<<<<< + * + * return topic_assignments + */ + tmq_free_assignment(__pyx_v_assignment_ptr); + + /* "taos/_objects.pyx":586 + * tmq_free_assignment(assignment_ptr) + * + * return topic_assignments # <<<<<<<<<<<<<< + * + * def offset_seek(self, topic: str, vg_id: int, offset: int): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_topic_assignments); + __pyx_r = __pyx_v_topic_assignments; + goto __pyx_L0; + + /* "taos/_objects.pyx":568 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def get_topic_assignment(self, topic: str): # <<<<<<<<<<<<<< + * cdef int32_t num_of_assignment + * cdef tmq_topic_assignment *assignment_ptr = NULL + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_topic_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__topic); + __Pyx_XDECREF(__pyx_v_topic_assignments); + __Pyx_XDECREF((PyObject *)__pyx_v_tta); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":588 + * return topic_assignments + * + * def offset_seek(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_17offset_seek(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_16offset_seek, "TaosConsumer.offset_seek(self, unicode topic: str, int vg_id: int, int offset: int)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_17offset_seek = {"offset_seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_17offset_seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_16offset_seek}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_17offset_seek(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_topic = 0; + PyObject *__pyx_v_vg_id = 0; + PyObject *__pyx_v_offset = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("offset_seek (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,&__pyx_n_s_vg_id,&__pyx_n_s_offset,0}; + PyObject* values[3] = {0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("offset_seek", 1, 3, 3, 1); __PYX_ERR(0, 588, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("offset_seek", 1, 3, 3, 2); __PYX_ERR(0, 588, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "offset_seek") < 0)) __PYX_ERR(0, 588, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_topic = ((PyObject*)values[0]); + __pyx_v_vg_id = ((PyObject*)values[1]); + __pyx_v_offset = ((PyObject*)values[2]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("offset_seek", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 588, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.offset_seek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 588, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg_id), (&PyInt_Type), 0, "vg_id", 1))) __PYX_ERR(0, 588, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_offset), (&PyInt_Type), 0, "offset", 1))) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_16offset_seek(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic, __pyx_v_vg_id, __pyx_v_offset); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_16offset_seek(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id, PyObject *__pyx_v_offset) { + PyObject *__pyx_v__topic = NULL; + int32_t __pyx_v_tmq_errno; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + int32_t __pyx_t_3; + int64_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__52) + __Pyx_RefNannySetupContext("offset_seek", 0); + __Pyx_TraceCall("offset_seek", __pyx_f[0], 588, 0, __PYX_ERR(0, 588, __pyx_L1_error)); + + /* "taos/_objects.pyx":589 + * + * def offset_seek(self, topic: str, vg_id: int, offset: int): + * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< + * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + * if tmq_errno != 0: + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__topic = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":590 + * def offset_seek(self, topic: str, vg_id: int, offset: int): + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) # <<<<<<<<<<<<<< + * if tmq_errno != 0: + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_vg_id); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_v_tmq_errno = tmq_offset_seek(__pyx_v_self->_tmq, __pyx_t_2, __pyx_t_3, __pyx_t_4); + + /* "taos/_objects.pyx":591 + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + __pyx_t_5 = (__pyx_v_tmq_errno != 0); + if (unlikely(__pyx_t_5)) { + + /* "taos/_objects.pyx":592 + * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + * if tmq_errno != 0: + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< + * + * def position(self, topic: str, vg_id: int): + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_10 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 592, __pyx_L1_error) + + /* "taos/_objects.pyx":591 + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + * if tmq_errno != 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + */ + } + + /* "taos/_objects.pyx":588 + * return topic_assignments + * + * def offset_seek(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("taos._objects.TaosConsumer.offset_seek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__topic); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":594 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def position(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * pos = tmq_position(self._tmq, _topic, vg_id) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_19position(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_18position, "TaosConsumer.position(self, unicode topic: str, int vg_id: int)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_19position = {"position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_19position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_18position}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_19position(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_topic = 0; + PyObject *__pyx_v_vg_id = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("position (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,&__pyx_n_s_vg_id,0}; + PyObject* values[2] = {0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("position", 1, 2, 2, 1); __PYX_ERR(0, 594, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "position") < 0)) __PYX_ERR(0, 594, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_topic = ((PyObject*)values[0]); + __pyx_v_vg_id = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("position", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 594, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.position", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 594, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg_id), (&PyInt_Type), 0, "vg_id", 1))) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_18position(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic, __pyx_v_vg_id); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_18position(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id) { + PyObject *__pyx_v__topic = NULL; + int64_t __pyx_v_pos; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + int32_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__53) + __Pyx_RefNannySetupContext("position", 0); + __Pyx_TraceCall("position", __pyx_f[0], 594, 0, __PYX_ERR(0, 594, __pyx_L1_error)); + + /* "taos/_objects.pyx":595 + * + * def position(self, topic: str, vg_id: int): + * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< + * pos = tmq_position(self._tmq, _topic, vg_id) + * if pos < 0: + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__topic = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":596 + * def position(self, topic: str, vg_id: int): + * _topic = topic.encode("utf-8") + * pos = tmq_position(self._tmq, _topic, vg_id) # <<<<<<<<<<<<<< + * if pos < 0: + * raise TmqError(tmq_err2str(pos), pos) + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_vg_id); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_v_pos = tmq_position(__pyx_v_self->_tmq, __pyx_t_2, __pyx_t_3); + + /* "taos/_objects.pyx":597 + * _topic = topic.encode("utf-8") + * pos = tmq_position(self._tmq, _topic, vg_id) + * if pos < 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(pos), pos) + * + */ + __pyx_t_4 = (__pyx_v_pos < 0); + if (unlikely(__pyx_t_4)) { + + /* "taos/_objects.pyx":598 + * pos = tmq_position(self._tmq, _topic, vg_id) + * if pos < 0: + * raise TmqError(tmq_err2str(pos), pos) # <<<<<<<<<<<<<< + * + * return pos + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_pos)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_pos); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 598, __pyx_L1_error) + + /* "taos/_objects.pyx":597 + * _topic = topic.encode("utf-8") + * pos = tmq_position(self._tmq, _topic, vg_id) + * if pos < 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(pos), pos) + * + */ + } + + /* "taos/_objects.pyx":600 + * raise TmqError(tmq_err2str(pos), pos) + * + * return pos # <<<<<<<<<<<<<< + * + * def committed(self, topic: str, vg_id: int): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":594 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def position(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * pos = tmq_position(self._tmq, _topic, vg_id) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("taos._objects.TaosConsumer.position", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__topic); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":602 + * return pos + * + * def committed(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * offset = tmq_committed(self._tmq, _topic, vg_id) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_21committed(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_20committed, "TaosConsumer.committed(self, unicode topic: str, int vg_id: int)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_21committed = {"committed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_21committed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_20committed}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_21committed(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_topic = 0; + PyObject *__pyx_v_vg_id = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("committed (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,&__pyx_n_s_vg_id,0}; + PyObject* values[2] = {0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("committed", 1, 2, 2, 1); __PYX_ERR(0, 602, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "committed") < 0)) __PYX_ERR(0, 602, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_topic = ((PyObject*)values[0]); + __pyx_v_vg_id = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("committed", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 602, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.committed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 602, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg_id), (&PyInt_Type), 0, "vg_id", 1))) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_20committed(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic, __pyx_v_vg_id); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_20committed(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id) { + PyObject *__pyx_v__topic = NULL; + int64_t __pyx_v_offset; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + int32_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__54) + __Pyx_RefNannySetupContext("committed", 0); + __Pyx_TraceCall("committed", __pyx_f[0], 602, 0, __PYX_ERR(0, 602, __pyx_L1_error)); + + /* "taos/_objects.pyx":603 + * + * def committed(self, topic: str, vg_id: int): + * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< + * offset = tmq_committed(self._tmq, _topic, vg_id) + * if offset == -2147467247: + */ + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__topic = __pyx_t_1; + __pyx_t_1 = 0; + + /* "taos/_objects.pyx":604 + * def committed(self, topic: str, vg_id: int): + * _topic = topic.encode("utf-8") + * offset = tmq_committed(self._tmq, _topic, vg_id) # <<<<<<<<<<<<<< + * if offset == -2147467247: + * return None + */ + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_vg_id); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_v_offset = tmq_committed(__pyx_v_self->_tmq, __pyx_t_2, __pyx_t_3); + + /* "taos/_objects.pyx":605 + * _topic = topic.encode("utf-8") + * offset = tmq_committed(self._tmq, _topic, vg_id) + * if offset == -2147467247: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_4 = (__pyx_v_offset == -2147467247L); + if (__pyx_t_4) { + + /* "taos/_objects.pyx":606 + * offset = tmq_committed(self._tmq, _topic, vg_id) + * if offset == -2147467247: + * return None # <<<<<<<<<<<<<< + * + * if offset < 0: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "taos/_objects.pyx":605 + * _topic = topic.encode("utf-8") + * offset = tmq_committed(self._tmq, _topic, vg_id) + * if offset == -2147467247: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "taos/_objects.pyx":608 + * return None + * + * if offset < 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(offset), offset) + * + */ + __pyx_t_4 = (__pyx_v_offset < 0); + if (unlikely(__pyx_t_4)) { + + /* "taos/_objects.pyx":609 + * + * if offset < 0: + * raise TmqError(tmq_err2str(offset), offset) # <<<<<<<<<<<<<< + * + * return offset + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_offset)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + { + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 609, __pyx_L1_error) + + /* "taos/_objects.pyx":608 + * return None + * + * if offset < 0: # <<<<<<<<<<<<<< + * raise TmqError(tmq_err2str(offset), offset) + * + */ + } + + /* "taos/_objects.pyx":611 + * raise TmqError(tmq_err2str(offset), offset) + * + * return offset # <<<<<<<<<<<<<< + * + * def get_topic_name(self, taos_res: TaosResult): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":602 + * return pos + * + * def committed(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * offset = tmq_committed(self._tmq, _topic, vg_id) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("taos._objects.TaosConsumer.committed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__topic); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":613 + * return offset + * + * def get_topic_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_topic_name(taos_res._res) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_23get_topic_name(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_22get_topic_name, "TaosConsumer.get_topic_name(self, TaosResult taos_res: TaosResult)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_23get_topic_name = {"get_topic_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_23get_topic_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_22get_topic_name}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_23get_topic_name(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_topic_name (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 613, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_topic_name") < 0)) __PYX_ERR(0, 613, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_topic_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 613, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_topic_name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_22get_topic_name(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_22get_topic_name(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__55) + __Pyx_RefNannySetupContext("get_topic_name", 0); + __Pyx_TraceCall("get_topic_name", __pyx_f[0], 613, 0, __PYX_ERR(0, 613, __pyx_L1_error)); + + /* "taos/_objects.pyx":614 + * + * def get_topic_name(self, taos_res: TaosResult): + * return tmq_get_topic_name(taos_res._res) # <<<<<<<<<<<<<< + * + * def get_db_name(self, taos_res: TaosResult): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBytes_FromString(tmq_get_topic_name(__pyx_v_taos_res->_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":613 + * return offset + * + * def get_topic_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_topic_name(taos_res._res) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_topic_name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":616 + * return tmq_get_topic_name(taos_res._res) + * + * def get_db_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_db_name(taos_res._res) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_25get_db_name(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_24get_db_name, "TaosConsumer.get_db_name(self, TaosResult taos_res: TaosResult)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_25get_db_name = {"get_db_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_25get_db_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_24get_db_name}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_25get_db_name(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_db_name (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 616, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_db_name") < 0)) __PYX_ERR(0, 616, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_db_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 616, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_db_name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_24get_db_name(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_24get_db_name(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__56) + __Pyx_RefNannySetupContext("get_db_name", 0); + __Pyx_TraceCall("get_db_name", __pyx_f[0], 616, 0, __PYX_ERR(0, 616, __pyx_L1_error)); + + /* "taos/_objects.pyx":617 + * + * def get_db_name(self, taos_res: TaosResult): + * return tmq_get_db_name(taos_res._res) # <<<<<<<<<<<<<< + * + * def get_vgroup_id(self, taos_res: TaosResult): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBytes_FromString(tmq_get_db_name(__pyx_v_taos_res->_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":616 + * return tmq_get_topic_name(taos_res._res) + * + * def get_db_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_db_name(taos_res._res) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_db_name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":619 + * return tmq_get_db_name(taos_res._res) + * + * def get_vgroup_id(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_vgroup_id(taos_res._res) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_27get_vgroup_id(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_26get_vgroup_id, "TaosConsumer.get_vgroup_id(self, TaosResult taos_res: TaosResult)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_27get_vgroup_id = {"get_vgroup_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_27get_vgroup_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_26get_vgroup_id}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_27get_vgroup_id(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_vgroup_id (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_vgroup_id") < 0)) __PYX_ERR(0, 619, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_vgroup_id", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 619, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_vgroup_id", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 619, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_26get_vgroup_id(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_26get_vgroup_id(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__57) + __Pyx_RefNannySetupContext("get_vgroup_id", 0); + __Pyx_TraceCall("get_vgroup_id", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error)); + + /* "taos/_objects.pyx":620 + * + * def get_vgroup_id(self, taos_res: TaosResult): + * return tmq_get_vgroup_id(taos_res._res) # <<<<<<<<<<<<<< + * + * def get_vgroup_offset(self, taos_res: TaosResult): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int32_t(tmq_get_vgroup_id(__pyx_v_taos_res->_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":619 + * return tmq_get_db_name(taos_res._res) + * + * def get_vgroup_id(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_vgroup_id(taos_res._res) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_vgroup_id", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":622 + * return tmq_get_vgroup_id(taos_res._res) + * + * def get_vgroup_offset(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_vgroup_offset(taos_res._res) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_29get_vgroup_offset(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_28get_vgroup_offset, "TaosConsumer.get_vgroup_offset(self, TaosResult taos_res: TaosResult)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_29get_vgroup_offset = {"get_vgroup_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_29get_vgroup_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_28get_vgroup_offset}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_29get_vgroup_offset(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_vgroup_offset (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_vgroup_offset") < 0)) __PYX_ERR(0, 622, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_vgroup_offset", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 622, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_vgroup_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_28get_vgroup_offset(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_28get_vgroup_offset(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__58) + __Pyx_RefNannySetupContext("get_vgroup_offset", 0); + __Pyx_TraceCall("get_vgroup_offset", __pyx_f[0], 622, 0, __PYX_ERR(0, 622, __pyx_L1_error)); + + /* "taos/_objects.pyx":623 + * + * def get_vgroup_offset(self, taos_res: TaosResult): + * return tmq_get_vgroup_offset(taos_res._res) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int64_t(tmq_get_vgroup_offset(__pyx_v_taos_res->_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "taos/_objects.pyx":622 + * return tmq_get_vgroup_id(taos_res._res) + * + * def get_vgroup_offset(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_vgroup_offset(taos_res._res) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._objects.TaosConsumer.get_vgroup_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_objects.pyx":625 + * return tmq_get_vgroup_offset(taos_res._res) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self._tmq_conf is not NULL: + * tmq_conf_destroy(self._tmq_conf) + */ + +/* Python wrapper */ +static void __pyx_pw_4taos_8_objects_12TaosConsumer_31__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_4taos_8_objects_12TaosConsumer_31__dealloc__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_4taos_8_objects_12TaosConsumer_30__dealloc__(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_4taos_8_objects_12TaosConsumer_30__dealloc__(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self) { + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__dealloc__", 0); + __Pyx_TraceCall("__dealloc__", __pyx_f[0], 625, 0, __PYX_ERR(0, 625, __pyx_L1_error)); + + /* "taos/_objects.pyx":626 + * + * def __dealloc__(self): + * if self._tmq_conf is not NULL: # <<<<<<<<<<<<<< + * tmq_conf_destroy(self._tmq_conf) + * self._tmq_conf = NULL + */ + __pyx_t_1 = (__pyx_v_self->_tmq_conf != NULL); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":627 + * def __dealloc__(self): + * if self._tmq_conf is not NULL: + * tmq_conf_destroy(self._tmq_conf) # <<<<<<<<<<<<<< + * self._tmq_conf = NULL + * + */ + tmq_conf_destroy(__pyx_v_self->_tmq_conf); + + /* "taos/_objects.pyx":628 + * if self._tmq_conf is not NULL: + * tmq_conf_destroy(self._tmq_conf) + * self._tmq_conf = NULL # <<<<<<<<<<<<<< + * + * if self._tmq is not NULL: + */ + __pyx_v_self->_tmq_conf = NULL; + + /* "taos/_objects.pyx":626 + * + * def __dealloc__(self): + * if self._tmq_conf is not NULL: # <<<<<<<<<<<<<< + * tmq_conf_destroy(self._tmq_conf) + * self._tmq_conf = NULL + */ + } + + /* "taos/_objects.pyx":630 + * self._tmq_conf = NULL + * + * if self._tmq is not NULL: # <<<<<<<<<<<<<< + * tmq_consumer_close(self._tmq) + * self._tmq = NULL + */ + __pyx_t_1 = (__pyx_v_self->_tmq != NULL); + if (__pyx_t_1) { + + /* "taos/_objects.pyx":631 + * + * if self._tmq is not NULL: + * tmq_consumer_close(self._tmq) # <<<<<<<<<<<<<< + * self._tmq = NULL + * + */ + (void)(tmq_consumer_close(__pyx_v_self->_tmq)); + + /* "taos/_objects.pyx":632 + * if self._tmq is not NULL: + * tmq_consumer_close(self._tmq) + * self._tmq = NULL # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->_tmq = NULL; + + /* "taos/_objects.pyx":630 + * self._tmq_conf = NULL + * + * if self._tmq is not NULL: # <<<<<<<<<<<<<< + * tmq_consumer_close(self._tmq) + * self._tmq = NULL + */ + } + + /* "taos/_objects.pyx":625 + * return tmq_get_vgroup_offset(taos_res._res) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self._tmq_conf is not NULL: + * tmq_conf_destroy(self._tmq_conf) + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("taos._objects.TaosConsumer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_33__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_32__reduce_cython__, "TaosConsumer.__reduce_cython__(self)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_32__reduce_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_33__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_32__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__59) + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_35__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_34__setstate_cython__, "TaosConsumer.__setstate_cython__(self, __pyx_state)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_34__setstate_cython__}; +static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_35__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; + PyObject* values[1] = {0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v___pyx_state = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_34__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__60) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); + + /* "(tree fragment)":4 + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("taos._objects.TaosConsumer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4taos_8_objects_3__pyx_unpickle_TaosCursor(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4taos_8_objects_2__pyx_unpickle_TaosCursor, "__pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state)"); +static PyMethodDef __pyx_mdef_4taos_8_objects_3__pyx_unpickle_TaosCursor = {"__pyx_unpickle_TaosCursor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_3__pyx_unpickle_TaosCursor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_2__pyx_unpickle_TaosCursor}; +static PyObject *__pyx_pw_4taos_8_objects_3__pyx_unpickle_TaosCursor(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_TaosCursor (wrapper)", 0); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaosCursor", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaosCursor", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_TaosCursor") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaosCursor", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("taos._objects.__pyx_unpickle_TaosCursor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4taos_8_objects_2__pyx_unpickle_TaosCursor(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4taos_8_objects_2__pyx_unpickle_TaosCursor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = 0; + PyObject *__pyx_v___pyx_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__61) + __Pyx_RefNannySetupContext("__pyx_unpickle_TaosCursor", 0); + __Pyx_TraceCall("__pyx_unpickle_TaosCursor", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum + */ + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__62, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "(tree fragment)":5 + * cdef object __pyx_result + * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum + * __pyx_result = TaosCursor.__new__(__pyx_type) + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v___pyx_PickleError = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum # <<<<<<<<<<<<<< + * __pyx_result = TaosCursor.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 6, __pyx_L1_error) + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum + */ + } + + /* "(tree fragment)":7 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum + * __pyx_result = TaosCursor.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v___pyx_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum + * __pyx_result = TaosCursor.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_2 = (__pyx_v___pyx_state != Py_None); + if (__pyx_t_2) { + + /* "(tree fragment)":9 + * __pyx_result = TaosCursor.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4taos_8_objects___pyx_unpickle_TaosCursor__set_state(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":8 + * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum + * __pyx_result = TaosCursor.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":10 + * if __pyx_state is not None: + * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): + * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("taos._objects.__pyx_unpickle_TaosCursor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":11 + * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] + * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_f_4taos_8_objects___pyx_unpickle_TaosCursor__set_state(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_unpickle_TaosCursor__set_state", 0); + __Pyx_TraceCall("__pyx_unpickle_TaosCursor__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); + + /* "(tree fragment)":12 + * return __pyx_result + * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): + * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[3]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4taos_8_objects_TaosConnection))))) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->_connection); + __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->_connection); + __pyx_v___pyx_result->_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_t_1); + __pyx_t_1 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->_description); + __Pyx_DECREF(__pyx_v___pyx_result->_description); + __pyx_v___pyx_result->_description = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4taos_8_objects_TaosResult))))) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->_result); + __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->_result); + __pyx_v___pyx_result->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): + * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] + * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[3]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 13, __pyx_L1_error) + } + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_3 > 3); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_2 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "(tree fragment)":14 + * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] + * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[3]) # <<<<<<<<<<<<<< + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 14, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":13 + * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): + * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] + * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[3]) + */ + } + + /* "(tree fragment)":11 + * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] + * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("taos._objects.__pyx_unpickle_TaosCursor__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_4taos_8_objects_TaosConnection(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + #endif + if (unlikely(__pyx_pw_4taos_8_objects_14TaosConnection_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_4taos_8_objects_TaosConnection(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosConnection) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_4taos_8_objects_14TaosConnection_9__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_14TaosConnection_client_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_14TaosConnection_11client_info_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_14TaosConnection_server_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_14TaosConnection_11server_info_1__get__(o); +} + +static PyMethodDef __pyx_methods_4taos_8_objects_TaosConnection[] = { + {"_init_options", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_3_init_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_2_init_options}, + {"_init_conn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_5_init_conn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_4_init_conn}, + {"_check_conn_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_7_check_conn_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_6_check_conn_error}, + {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_11close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_10close}, + {"select_db", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_13select_db, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_12select_db}, + {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_15execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_14execute}, + {"query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_17query, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_16query}, + {"query_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_19query_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_18query_a}, + {"subscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_21subscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_20subscribe}, + {"load_table_info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_23load_table_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_22load_table_info}, + {"commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_25commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_24commit}, + {"rollback", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_27rollback, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_26rollback}, + {"clear_result_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_29clear_result_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_28clear_result_set}, + {"get_table_vgroup_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_31get_table_vgroup_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_30get_table_vgroup_id}, + {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_32__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_34__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosConnection[] = { + {(char *)"client_info", __pyx_getprop_4taos_8_objects_14TaosConnection_client_info, 0, (char *)0, 0}, + {(char *)"server_info", __pyx_getprop_4taos_8_objects_14TaosConnection_server_info, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4taos_8_objects_TaosConnection_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosConnection}, + {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosConnection}, + {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosConnection}, + {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosConnection}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4taos_8_objects_TaosConnection_spec = { + "taos._objects.TaosConnection", + sizeof(struct __pyx_obj_4taos_8_objects_TaosConnection), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, + __pyx_type_4taos_8_objects_TaosConnection_slots, +}; +#else + +static PyTypeObject __pyx_type_4taos_8_objects_TaosConnection = { + PyVarObject_HEAD_INIT(0, 0) + "taos._objects.""TaosConnection", /*tp_name*/ + sizeof(struct __pyx_obj_4taos_8_objects_TaosConnection), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4taos_8_objects_TaosConnection, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4taos_8_objects_TaosConnection, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_4taos_8_objects_TaosConnection, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4taos_8_objects_TaosConnection, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyObject *__pyx_tp_new_4taos_8_objects_TaosField(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4taos_8_objects_TaosField *p; + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + #endif + p = ((struct __pyx_obj_4taos_8_objects_TaosField *)o); + p->_name = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4taos_8_objects_9TaosField_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_4taos_8_objects_TaosField(PyObject *o) { + struct __pyx_obj_4taos_8_objects_TaosField *p = (struct __pyx_obj_4taos_8_objects_TaosField *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosField) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + Py_CLEAR(p->_name); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_4taos_8_objects_TaosField(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static PyObject *__pyx_getprop_4taos_8_objects_9TaosField_name(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_9TaosField_4name_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_9TaosField_type(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_9TaosField_4type_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_9TaosField_bytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_9TaosField_5bytes_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_9TaosField_length(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_9TaosField_6length_1__get__(o); +} + +static PyObject *__pyx_specialmethod___pyx_pw_4taos_8_objects_9TaosField_5__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { + return __pyx_pw_4taos_8_objects_9TaosField_5__repr__(self); +} + +static PyMethodDef __pyx_methods_4taos_8_objects_TaosField[] = { + {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_4taos_8_objects_9TaosField_5__repr__, METH_NOARGS|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_9TaosField_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_9TaosField_8__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_9TaosField_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_9TaosField_10__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosField[] = { + {(char *)"name", __pyx_getprop_4taos_8_objects_9TaosField_name, 0, (char *)0, 0}, + {(char *)"type", __pyx_getprop_4taos_8_objects_9TaosField_type, 0, (char *)0, 0}, + {(char *)"bytes", __pyx_getprop_4taos_8_objects_9TaosField_bytes, 0, (char *)0, 0}, + {(char *)"length", __pyx_getprop_4taos_8_objects_9TaosField_length, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4taos_8_objects_TaosField_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosField}, + {Py_tp_repr, (void *)__pyx_pw_4taos_8_objects_9TaosField_5__repr__}, + {Py_sq_item, (void *)__pyx_sq_item_4taos_8_objects_TaosField}, + {Py_mp_subscript, (void *)__pyx_pw_4taos_8_objects_9TaosField_7__getitem__}, + {Py_tp_str, (void *)__pyx_pw_4taos_8_objects_9TaosField_3__str__}, + {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosField}, + {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosField}, + {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosField}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4taos_8_objects_TaosField_spec = { + "taos._objects.TaosField", + sizeof(struct __pyx_obj_4taos_8_objects_TaosField), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, + __pyx_type_4taos_8_objects_TaosField_slots, +}; +#else + +static PySequenceMethods __pyx_tp_as_sequence_TaosField = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_4taos_8_objects_TaosField, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_TaosField = { + 0, /*mp_length*/ + __pyx_pw_4taos_8_objects_9TaosField_7__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_4taos_8_objects_TaosField = { + PyVarObject_HEAD_INIT(0, 0) + "taos._objects.""TaosField", /*tp_name*/ + sizeof(struct __pyx_obj_4taos_8_objects_TaosField), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4taos_8_objects_TaosField, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_4taos_8_objects_9TaosField_5__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_TaosField, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_TaosField, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_4taos_8_objects_9TaosField_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4taos_8_objects_TaosField, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_4taos_8_objects_TaosField, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4taos_8_objects_TaosField, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyObject *__pyx_tp_new_4taos_8_objects_TaosResult(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + #endif + if (unlikely(__pyx_pw_4taos_8_objects_10TaosResult_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_4taos_8_objects_TaosResult(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosResult) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_4taos_8_objects_10TaosResult_29__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_fields(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_10TaosResult_6fields_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_field_count(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_10TaosResult_11field_count_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_precision(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_10TaosResult_9precision_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_affected_rows(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_10TaosResult_13affected_rows_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_row_count(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_10TaosResult_9row_count_1__get__(o); +} + +static PyObject *__pyx_specialmethod___pyx_pw_4taos_8_objects_10TaosResult_5__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { + return __pyx_pw_4taos_8_objects_10TaosResult_5__repr__(self); +} + +static PyMethodDef __pyx_methods_4taos_8_objects_TaosResult[] = { + {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_4taos_8_objects_10TaosResult_5__repr__, METH_NOARGS|METH_COEXIST, 0}, + {"_check_result_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_9_check_result_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_8_check_result_error}, + {"_fetch_block", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_11_fetch_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_10_fetch_block}, + {"fetch_block", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_13fetch_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_12fetch_block}, + {"fetch_all", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_15fetch_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_14fetch_all}, + {"fetch_all_into_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_17fetch_all_into_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_16fetch_all_into_dict}, + {"rows_iter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_19rows_iter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_18rows_iter}, + {"blocks_iter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_22blocks_iter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_21blocks_iter}, + {"fetch_rows_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_25fetch_rows_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_24fetch_rows_a}, + {"taos_fetch_raw_block_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a}, + {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_30__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_32__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosResult[] = { + {(char *)"fields", __pyx_getprop_4taos_8_objects_10TaosResult_fields, 0, (char *)0, 0}, + {(char *)"field_count", __pyx_getprop_4taos_8_objects_10TaosResult_field_count, 0, (char *)0, 0}, + {(char *)"precision", __pyx_getprop_4taos_8_objects_10TaosResult_precision, 0, (char *)0, 0}, + {(char *)"affected_rows", __pyx_getprop_4taos_8_objects_10TaosResult_affected_rows, 0, (char *)0, 0}, + {(char *)"row_count", __pyx_getprop_4taos_8_objects_10TaosResult_row_count, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4taos_8_objects_TaosResult_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosResult}, + {Py_tp_repr, (void *)__pyx_pw_4taos_8_objects_10TaosResult_5__repr__}, + {Py_tp_str, (void *)__pyx_pw_4taos_8_objects_10TaosResult_3__str__}, + {Py_tp_iter, (void *)__pyx_pw_4taos_8_objects_10TaosResult_7__iter__}, + {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosResult}, + {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosResult}, + {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosResult}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4taos_8_objects_TaosResult_spec = { + "taos._objects.TaosResult", + sizeof(struct __pyx_obj_4taos_8_objects_TaosResult), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, + __pyx_type_4taos_8_objects_TaosResult_slots, +}; +#else + +static PyTypeObject __pyx_type_4taos_8_objects_TaosResult = { + PyVarObject_HEAD_INIT(0, 0) + "taos._objects.""TaosResult", /*tp_name*/ + sizeof(struct __pyx_obj_4taos_8_objects_TaosResult), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4taos_8_objects_TaosResult, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_4taos_8_objects_10TaosResult_5__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_4taos_8_objects_10TaosResult_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_4taos_8_objects_10TaosResult_7__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4taos_8_objects_TaosResult, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_4taos_8_objects_TaosResult, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4taos_8_objects_TaosResult, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyObject *__pyx_tp_new_4taos_8_objects_TaosCursor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_4taos_8_objects_TaosCursor *p; + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + #endif + p = ((struct __pyx_obj_4taos_8_objects_TaosCursor *)o); + p->_description = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)Py_None); Py_INCREF(Py_None); + p->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)Py_None); Py_INCREF(Py_None); + return o; +} + +#if CYTHON_USE_TP_FINALIZE +static void __pyx_tp_finalize_4taos_8_objects_TaosCursor(PyObject *o) { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __pyx_pw_4taos_8_objects_10TaosCursor_16__del__(o); + PyErr_Restore(etype, eval, etb); +} +#endif + +static void __pyx_tp_dealloc_4taos_8_objects_TaosCursor(PyObject *o) { + struct __pyx_obj_4taos_8_objects_TaosCursor *p = (struct __pyx_obj_4taos_8_objects_TaosCursor *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosCursor) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_description); + Py_CLEAR(p->_connection); + Py_CLEAR(p->_result); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_4taos_8_objects_TaosCursor(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4taos_8_objects_TaosCursor *p = (struct __pyx_obj_4taos_8_objects_TaosCursor *)o; + if (p->_description) { + e = (*v)(p->_description, a); if (e) return e; + } + if (p->_connection) { + e = (*v)(((PyObject *)p->_connection), a); if (e) return e; + } + if (p->_result) { + e = (*v)(((PyObject *)p->_result), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_4taos_8_objects_TaosCursor(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4taos_8_objects_TaosCursor *p = (struct __pyx_obj_4taos_8_objects_TaosCursor *)o; + tmp = ((PyObject*)p->_description); + p->_description = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_connection); + p->_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_result); + p->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_4taos_8_objects_10TaosCursor_description(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_10TaosCursor_11description_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_10TaosCursor_rowcount(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_10TaosCursor_8rowcount_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_10TaosCursor_affected_rows(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_10TaosCursor_13affected_rows_1__get__(o); +} + +static PyMethodDef __pyx_methods_4taos_8_objects_TaosCursor[] = { + {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_6execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_5execute}, + {"fetchone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_8fetchone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_7fetchone}, + {"fetchall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_10fetchall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_9fetchall}, + {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_12close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_11close}, + {"_reset_result", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_14_reset_result, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_13_reset_result}, + {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_18__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_17__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_20__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_19__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosCursor[] = { + {(char *)"description", __pyx_getprop_4taos_8_objects_10TaosCursor_description, 0, (char *)0, 0}, + {(char *)"rowcount", __pyx_getprop_4taos_8_objects_10TaosCursor_rowcount, 0, (char *)0, 0}, + {(char *)"affected_rows", __pyx_getprop_4taos_8_objects_10TaosCursor_affected_rows, 0, (char *)PyDoc_STR("Return the rowcount of insertion"), 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4taos_8_objects_TaosCursor_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosCursor}, + {Py_tp_doc, (void *)PyDoc_STR("TaosCursor(TaosConnection connection: TaosConnection = None) -> None")}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects_TaosCursor}, + {Py_tp_clear, (void *)__pyx_tp_clear_4taos_8_objects_TaosCursor}, + {Py_tp_iter, (void *)__pyx_pw_4taos_8_objects_10TaosCursor_3__iter__}, + {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosCursor}, + {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosCursor}, + {Py_tp_init, (void *)__pyx_pw_4taos_8_objects_10TaosCursor_1__init__}, + {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosCursor}, + #if PY_VERSION_HEX >= 0x030400a1 + {Py_tp_finalize, (void *)__pyx_tp_finalize_4taos_8_objects_TaosCursor}, + #endif + {0, 0}, +}; +static PyType_Spec __pyx_type_4taos_8_objects_TaosCursor_spec = { + "taos._objects.TaosCursor", + sizeof(struct __pyx_obj_4taos_8_objects_TaosCursor), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_4taos_8_objects_TaosCursor_slots, +}; +#else + +static PyTypeObject __pyx_type_4taos_8_objects_TaosCursor = { + PyVarObject_HEAD_INIT(0, 0) + "taos._objects.""TaosCursor", /*tp_name*/ + sizeof(struct __pyx_obj_4taos_8_objects_TaosCursor), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4taos_8_objects_TaosCursor, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + PyDoc_STR("TaosCursor(TaosConnection connection: TaosConnection = None) -> None"), /*tp_doc*/ + __pyx_tp_traverse_4taos_8_objects_TaosCursor, /*tp_traverse*/ + __pyx_tp_clear_4taos_8_objects_TaosCursor, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_4taos_8_objects_10TaosCursor_3__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4taos_8_objects_TaosCursor, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_4taos_8_objects_TaosCursor, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + __pyx_pw_4taos_8_objects_10TaosCursor_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4taos_8_objects_TaosCursor, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + __pyx_tp_finalize_4taos_8_objects_TaosCursor, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyObject *__pyx_tp_new_4taos_8_objects_TaosTopicAssignment(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + #endif + if (unlikely(__pyx_pw_4taos_8_objects_19TaosTopicAssignment_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_4taos_8_objects_TaosTopicAssignment(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosTopicAssignment) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_19TaosTopicAssignment_vg_id(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_19TaosTopicAssignment_5vg_id_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_19TaosTopicAssignment_current_offset(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_19TaosTopicAssignment_14current_offset_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_19TaosTopicAssignment_begin(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_19TaosTopicAssignment_5begin_1__get__(o); +} + +static PyObject *__pyx_getprop_4taos_8_objects_19TaosTopicAssignment_end(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_4taos_8_objects_19TaosTopicAssignment_3end_1__get__(o); +} + +static PyMethodDef __pyx_methods_4taos_8_objects_TaosTopicAssignment[] = { + {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosTopicAssignment[] = { + {(char *)"vg_id", __pyx_getprop_4taos_8_objects_19TaosTopicAssignment_vg_id, 0, (char *)0, 0}, + {(char *)"current_offset", __pyx_getprop_4taos_8_objects_19TaosTopicAssignment_current_offset, 0, (char *)0, 0}, + {(char *)"begin", __pyx_getprop_4taos_8_objects_19TaosTopicAssignment_begin, 0, (char *)0, 0}, + {(char *)"end", __pyx_getprop_4taos_8_objects_19TaosTopicAssignment_end, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4taos_8_objects_TaosTopicAssignment_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosTopicAssignment}, + {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosTopicAssignment}, + {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosTopicAssignment}, + {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosTopicAssignment}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4taos_8_objects_TaosTopicAssignment_spec = { + "taos._objects.TaosTopicAssignment", + sizeof(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, + __pyx_type_4taos_8_objects_TaosTopicAssignment_slots, +}; +#else + +static PyTypeObject __pyx_type_4taos_8_objects_TaosTopicAssignment = { + PyVarObject_HEAD_INIT(0, 0) + "taos._objects.""TaosTopicAssignment", /*tp_name*/ + sizeof(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4taos_8_objects_TaosTopicAssignment, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4taos_8_objects_TaosTopicAssignment, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_4taos_8_objects_TaosTopicAssignment, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4taos_8_objects_TaosTopicAssignment, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyObject *__pyx_tp_new_4taos_8_objects_TaosConsumer(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_4taos_8_objects_TaosConsumer *p; + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + #endif + p = ((struct __pyx_obj_4taos_8_objects_TaosConsumer *)o); + p->_configs = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_4taos_8_objects_12TaosConsumer_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_4taos_8_objects_TaosConsumer(PyObject *o) { + struct __pyx_obj_4taos_8_objects_TaosConsumer *p = (struct __pyx_obj_4taos_8_objects_TaosConsumer *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosConsumer) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_4taos_8_objects_12TaosConsumer_31__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->_configs); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_4taos_8_objects_TaosConsumer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4taos_8_objects_TaosConsumer *p = (struct __pyx_obj_4taos_8_objects_TaosConsumer *)o; + if (p->_configs) { + e = (*v)(p->_configs, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_4taos_8_objects_TaosConsumer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_4taos_8_objects_TaosConsumer *p = (struct __pyx_obj_4taos_8_objects_TaosConsumer *)o; + tmp = ((PyObject*)p->_configs); + p->_configs = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_4taos_8_objects_TaosConsumer[] = { + {"subscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_3subscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_2subscribe}, + {"unsubscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_5unsubscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_4unsubscribe}, + {"poll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_7poll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_6poll}, + {"commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_9commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_8commit}, + {"result_commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_11result_commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_10result_commit}, + {"offset_commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_13offset_commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_12offset_commit}, + {"get_topic_assignment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_15get_topic_assignment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_14get_topic_assignment}, + {"offset_seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_17offset_seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_16offset_seek}, + {"position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_19position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_18position}, + {"committed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_21committed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_20committed}, + {"get_topic_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_23get_topic_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_22get_topic_name}, + {"get_db_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_25get_db_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_24get_db_name}, + {"get_vgroup_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_27get_vgroup_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_26get_vgroup_id}, + {"get_vgroup_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_29get_vgroup_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_28get_vgroup_offset}, + {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_32__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_34__setstate_cython__}, + {0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4taos_8_objects_TaosConsumer_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosConsumer}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects_TaosConsumer}, + {Py_tp_clear, (void *)__pyx_tp_clear_4taos_8_objects_TaosConsumer}, + {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosConsumer}, + {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosConsumer}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4taos_8_objects_TaosConsumer_spec = { + "taos._objects.TaosConsumer", + sizeof(struct __pyx_obj_4taos_8_objects_TaosConsumer), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, + __pyx_type_4taos_8_objects_TaosConsumer_slots, +}; +#else + +static PyTypeObject __pyx_type_4taos_8_objects_TaosConsumer = { + PyVarObject_HEAD_INIT(0, 0) + "taos._objects.""TaosConsumer", /*tp_name*/ + sizeof(struct __pyx_obj_4taos_8_objects_TaosConsumer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4taos_8_objects_TaosConsumer, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_4taos_8_objects_TaosConsumer, /*tp_traverse*/ + __pyx_tp_clear_4taos_8_objects_TaosConsumer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4taos_8_objects_TaosConsumer, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4taos_8_objects_TaosConsumer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *__pyx_freelist_4taos_8_objects___pyx_scope_struct__rows_iter[8]; +static int __pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter = 0; + +static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter)))) { + o = (PyObject*)__pyx_freelist_4taos_8_objects___pyx_scope_struct__rows_iter[--__pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter]; + memset(o, 0, sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct__rows_iter(PyObject *o) { + struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct__rows_iter) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_dt_epoch); + Py_CLEAR(p->__pyx_v_is_null); + Py_CLEAR(p->__pyx_v_row); + Py_CLEAR(p->__pyx_v_self); + if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter)))) { + __pyx_freelist_4taos_8_objects___pyx_scope_struct__rows_iter[__pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter++] = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct__rows_iter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)o; + if (p->__pyx_v_dt_epoch) { + e = (*v)(p->__pyx_v_dt_epoch, a); if (e) return e; + } + if (p->__pyx_v_is_null) { + e = (*v)(p->__pyx_v_is_null, a); if (e) return e; + } + if (p->__pyx_v_row) { + e = (*v)(p->__pyx_v_row, a); if (e) return e; + } + if (p->__pyx_v_self) { + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct__rows_iter}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects___pyx_scope_struct__rows_iter}, + {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_spec = { + "taos._objects.__pyx_scope_struct__rows_iter", + sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_slots, +}; +#else + +static PyTypeObject __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter = { + PyVarObject_HEAD_INIT(0, 0) + "taos._objects.""__pyx_scope_struct__rows_iter", /*tp_name*/ + sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct__rows_iter, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct__rows_iter, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *__pyx_freelist_4taos_8_objects___pyx_scope_struct_1_blocks_iter[8]; +static int __pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter = 0; + +static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter)))) { + o = (PyObject*)__pyx_freelist_4taos_8_objects___pyx_scope_struct_1_blocks_iter[--__pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter]; + memset(o, 0, sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_1_blocks_iter(PyObject *o) { + struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_1_blocks_iter) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_block); + Py_CLEAR(p->__pyx_v_num_of_rows); + Py_CLEAR(p->__pyx_8genexpr6__pyx_v_r); + Py_CLEAR(p->__pyx_v_self); + if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter)))) { + __pyx_freelist_4taos_8_objects___pyx_scope_struct_1_blocks_iter[__pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter++] = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_1_blocks_iter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)o; + if (p->__pyx_v_block) { + e = (*v)(p->__pyx_v_block, a); if (e) return e; + } + if (p->__pyx_v_num_of_rows) { + e = (*v)(p->__pyx_v_num_of_rows, a); if (e) return e; + } + if (p->__pyx_8genexpr6__pyx_v_r) { + e = (*v)(p->__pyx_8genexpr6__pyx_v_r, a); if (e) return e; + } + if (p->__pyx_v_self) { + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_1_blocks_iter}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_1_blocks_iter}, + {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_spec = { + "taos._objects.__pyx_scope_struct_1_blocks_iter", + sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_slots, +}; +#else + +static PyTypeObject __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter = { + PyVarObject_HEAD_INIT(0, 0) + "taos._objects.""__pyx_scope_struct_1_blocks_iter", /*tp_name*/ + sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_1_blocks_iter, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_1_blocks_iter, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *__pyx_freelist_4taos_8_objects___pyx_scope_struct_2___iter__[8]; +static int __pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__ = 0; + +static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__)))) { + o = (PyObject*)__pyx_freelist_4taos_8_objects___pyx_scope_struct_2___iter__[--__pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__]; + memset(o, 0, sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_2___iter__(PyObject *o) { + struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_2___iter__) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_block); + Py_CLEAR(p->__pyx_v_num_of_rows); + Py_CLEAR(p->__pyx_v_row); + Py_CLEAR(p->__pyx_v_self); + Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_t_1); + if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__)))) { + __pyx_freelist_4taos_8_objects___pyx_scope_struct_2___iter__[__pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__++] = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_2___iter__(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)o; + if (p->__pyx_v_block) { + e = (*v)(p->__pyx_v_block, a); if (e) return e; + } + if (p->__pyx_v_num_of_rows) { + e = (*v)(p->__pyx_v_num_of_rows, a); if (e) return e; + } + if (p->__pyx_v_row) { + e = (*v)(p->__pyx_v_row, a); if (e) return e; + } + if (p->__pyx_v_self) { + e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + if (p->__pyx_t_1) { + e = (*v)(p->__pyx_t_1, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_2___iter__}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_2___iter__}, + {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___spec = { + "taos._objects.__pyx_scope_struct_2___iter__", + sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___slots, +}; +#else + +static PyTypeObject __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__ = { + PyVarObject_HEAD_INIT(0, 0) + "taos._objects.""__pyx_scope_struct_2___iter__", /*tp_name*/ + sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_2___iter__, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_2___iter__, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_CONVERT_FUNC, __pyx_k_CONVERT_FUNC, sizeof(__pyx_k_CONVERT_FUNC), 0, 0, 1, 1}, + {&__pyx_n_s_ConnectionError, __pyx_k_ConnectionError, sizeof(__pyx_k_ConnectionError), 0, 0, 1, 1}, + {&__pyx_kp_u_Cursor_is_not_connected, __pyx_k_Cursor_is_not_connected, sizeof(__pyx_k_Cursor_is_not_connected), 0, 1, 0, 0}, + {&__pyx_n_s_DatabaseError, __pyx_k_DatabaseError, sizeof(__pyx_k_DatabaseError), 0, 0, 1, 1}, + {&__pyx_n_u_DictRow, __pyx_k_DictRow, sizeof(__pyx_k_DictRow), 0, 1, 0, 1}, + {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, + {&__pyx_n_s_InternalError, __pyx_k_InternalError, sizeof(__pyx_k_InternalError), 0, 0, 1, 1}, + {&__pyx_kp_u_Invalid_use_of_fetch_iterator, __pyx_k_Invalid_use_of_fetch_iterator, sizeof(__pyx_k_Invalid_use_of_fetch_iterator), 0, 1, 0, 0}, + {&__pyx_kp_u_Invalid_use_of_fetchall, __pyx_k_Invalid_use_of_fetchall, sizeof(__pyx_k_Invalid_use_of_fetchall), 0, 1, 0, 0}, + {&__pyx_kp_u_Invalid_use_of_rows_iter, __pyx_k_Invalid_use_of_rows_iter, sizeof(__pyx_k_Invalid_use_of_rows_iter), 0, 1, 0, 0}, + {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, + {&__pyx_n_s_OperationalError, __pyx_k_OperationalError, sizeof(__pyx_k_OperationalError), 0, 0, 1, 1}, + {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, + {&__pyx_kp_s_Optional_int, __pyx_k_Optional_int, sizeof(__pyx_k_Optional_int), 0, 0, 1, 0}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_ProgrammingError, __pyx_k_ProgrammingError, sizeof(__pyx_k_ProgrammingError), 0, 0, 1, 1}, + {&__pyx_n_s_SIZED_TYPE, __pyx_k_SIZED_TYPE, sizeof(__pyx_k_SIZED_TYPE), 0, 0, 1, 1}, + {&__pyx_n_s_StatementError, __pyx_k_StatementError, sizeof(__pyx_k_StatementError), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection, __pyx_k_TaosConnection, sizeof(__pyx_k_TaosConnection), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection___reduce_cython, __pyx_k_TaosConnection___reduce_cython, sizeof(__pyx_k_TaosConnection___reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection___setstate_cython, __pyx_k_TaosConnection___setstate_cython, sizeof(__pyx_k_TaosConnection___setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection__check_conn_error, __pyx_k_TaosConnection__check_conn_error, sizeof(__pyx_k_TaosConnection__check_conn_error), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection__init_conn, __pyx_k_TaosConnection__init_conn, sizeof(__pyx_k_TaosConnection__init_conn), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection__init_options, __pyx_k_TaosConnection__init_options, sizeof(__pyx_k_TaosConnection__init_options), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_clear_result_set, __pyx_k_TaosConnection_clear_result_set, sizeof(__pyx_k_TaosConnection_clear_result_set), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_close, __pyx_k_TaosConnection_close, sizeof(__pyx_k_TaosConnection_close), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_commit, __pyx_k_TaosConnection_commit, sizeof(__pyx_k_TaosConnection_commit), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_execute, __pyx_k_TaosConnection_execute, sizeof(__pyx_k_TaosConnection_execute), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_get_table_vgroup, __pyx_k_TaosConnection_get_table_vgroup, sizeof(__pyx_k_TaosConnection_get_table_vgroup), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_load_table_info, __pyx_k_TaosConnection_load_table_info, sizeof(__pyx_k_TaosConnection_load_table_info), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_query, __pyx_k_TaosConnection_query, sizeof(__pyx_k_TaosConnection_query), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_query_a, __pyx_k_TaosConnection_query_a, sizeof(__pyx_k_TaosConnection_query_a), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_rollback, __pyx_k_TaosConnection_rollback, sizeof(__pyx_k_TaosConnection_rollback), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_select_db, __pyx_k_TaosConnection_select_db, sizeof(__pyx_k_TaosConnection_select_db), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConnection_subscribe, __pyx_k_TaosConnection_subscribe, sizeof(__pyx_k_TaosConnection_subscribe), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer, __pyx_k_TaosConsumer, sizeof(__pyx_k_TaosConsumer), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer___reduce_cython, __pyx_k_TaosConsumer___reduce_cython, sizeof(__pyx_k_TaosConsumer___reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer___setstate_cython, __pyx_k_TaosConsumer___setstate_cython, sizeof(__pyx_k_TaosConsumer___setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_commit, __pyx_k_TaosConsumer_commit, sizeof(__pyx_k_TaosConsumer_commit), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_committed, __pyx_k_TaosConsumer_committed, sizeof(__pyx_k_TaosConsumer_committed), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_get_db_name, __pyx_k_TaosConsumer_get_db_name, sizeof(__pyx_k_TaosConsumer_get_db_name), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_get_topic_assignmen, __pyx_k_TaosConsumer_get_topic_assignmen, sizeof(__pyx_k_TaosConsumer_get_topic_assignmen), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_get_topic_name, __pyx_k_TaosConsumer_get_topic_name, sizeof(__pyx_k_TaosConsumer_get_topic_name), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_get_vgroup_id, __pyx_k_TaosConsumer_get_vgroup_id, sizeof(__pyx_k_TaosConsumer_get_vgroup_id), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_get_vgroup_offset, __pyx_k_TaosConsumer_get_vgroup_offset, sizeof(__pyx_k_TaosConsumer_get_vgroup_offset), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_offset_commit, __pyx_k_TaosConsumer_offset_commit, sizeof(__pyx_k_TaosConsumer_offset_commit), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_offset_seek, __pyx_k_TaosConsumer_offset_seek, sizeof(__pyx_k_TaosConsumer_offset_seek), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_poll, __pyx_k_TaosConsumer_poll, sizeof(__pyx_k_TaosConsumer_poll), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_position, __pyx_k_TaosConsumer_position, sizeof(__pyx_k_TaosConsumer_position), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_result_commit, __pyx_k_TaosConsumer_result_commit, sizeof(__pyx_k_TaosConsumer_result_commit), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_subscribe, __pyx_k_TaosConsumer_subscribe, sizeof(__pyx_k_TaosConsumer_subscribe), 0, 0, 1, 1}, + {&__pyx_n_s_TaosConsumer_unsubscribe, __pyx_k_TaosConsumer_unsubscribe, sizeof(__pyx_k_TaosConsumer_unsubscribe), 0, 0, 1, 1}, + {&__pyx_n_s_TaosCursor, __pyx_k_TaosCursor, sizeof(__pyx_k_TaosCursor), 0, 0, 1, 1}, + {&__pyx_n_s_TaosCursor___iter, __pyx_k_TaosCursor___iter, sizeof(__pyx_k_TaosCursor___iter), 0, 0, 1, 1}, + {&__pyx_n_s_TaosCursor___reduce_cython, __pyx_k_TaosCursor___reduce_cython, sizeof(__pyx_k_TaosCursor___reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_TaosCursor___setstate_cython, __pyx_k_TaosCursor___setstate_cython, sizeof(__pyx_k_TaosCursor___setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_TaosCursor__reset_result, __pyx_k_TaosCursor__reset_result, sizeof(__pyx_k_TaosCursor__reset_result), 0, 0, 1, 1}, + {&__pyx_n_s_TaosCursor_close, __pyx_k_TaosCursor_close, sizeof(__pyx_k_TaosCursor_close), 0, 0, 1, 1}, + {&__pyx_n_s_TaosCursor_execute, __pyx_k_TaosCursor_execute, sizeof(__pyx_k_TaosCursor_execute), 0, 0, 1, 1}, + {&__pyx_n_s_TaosCursor_fetchall, __pyx_k_TaosCursor_fetchall, sizeof(__pyx_k_TaosCursor_fetchall), 0, 0, 1, 1}, + {&__pyx_n_s_TaosCursor_fetchone, __pyx_k_TaosCursor_fetchone, sizeof(__pyx_k_TaosCursor_fetchone), 0, 0, 1, 1}, + {&__pyx_n_s_TaosField, __pyx_k_TaosField, sizeof(__pyx_k_TaosField), 0, 0, 1, 1}, + {&__pyx_n_s_TaosField___reduce_cython, __pyx_k_TaosField___reduce_cython, sizeof(__pyx_k_TaosField___reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_TaosField___setstate_cython, __pyx_k_TaosField___setstate_cython, sizeof(__pyx_k_TaosField___setstate_cython), 0, 0, 1, 1}, + {&__pyx_kp_u_TaosField_name, __pyx_k_TaosField_name, sizeof(__pyx_k_TaosField_name), 0, 1, 0, 0}, + {&__pyx_n_s_TaosResult, __pyx_k_TaosResult, sizeof(__pyx_k_TaosResult), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult___reduce_cython, __pyx_k_TaosResult___reduce_cython, sizeof(__pyx_k_TaosResult___reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult___setstate_cython, __pyx_k_TaosResult___setstate_cython, sizeof(__pyx_k_TaosResult___setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult__check_result_error, __pyx_k_TaosResult__check_result_error, sizeof(__pyx_k_TaosResult__check_result_error), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult__fetch_block, __pyx_k_TaosResult__fetch_block, sizeof(__pyx_k_TaosResult__fetch_block), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult_blocks_iter, __pyx_k_TaosResult_blocks_iter, sizeof(__pyx_k_TaosResult_blocks_iter), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult_fetch_all, __pyx_k_TaosResult_fetch_all, sizeof(__pyx_k_TaosResult_fetch_all), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult_fetch_all_into_dict, __pyx_k_TaosResult_fetch_all_into_dict, sizeof(__pyx_k_TaosResult_fetch_all_into_dict), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult_fetch_block, __pyx_k_TaosResult_fetch_block, sizeof(__pyx_k_TaosResult_fetch_block), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult_fetch_rows_a, __pyx_k_TaosResult_fetch_rows_a, sizeof(__pyx_k_TaosResult_fetch_rows_a), 0, 0, 1, 1}, + {&__pyx_kp_u_TaosResult_res, __pyx_k_TaosResult_res, sizeof(__pyx_k_TaosResult_res), 0, 1, 0, 0}, + {&__pyx_n_s_TaosResult_rows_iter, __pyx_k_TaosResult_rows_iter, sizeof(__pyx_k_TaosResult_rows_iter), 0, 0, 1, 1}, + {&__pyx_n_s_TaosResult_taos_fetch_raw_block, __pyx_k_TaosResult_taos_fetch_raw_block, sizeof(__pyx_k_TaosResult_taos_fetch_raw_block), 0, 0, 1, 1}, + {&__pyx_n_s_TaosTopicAssignment, __pyx_k_TaosTopicAssignment, sizeof(__pyx_k_TaosTopicAssignment), 0, 0, 1, 1}, + {&__pyx_n_s_TaosTopicAssignment___reduce_cyt, __pyx_k_TaosTopicAssignment___reduce_cyt, sizeof(__pyx_k_TaosTopicAssignment___reduce_cyt), 0, 0, 1, 1}, + {&__pyx_n_s_TaosTopicAssignment___setstate_c, __pyx_k_TaosTopicAssignment___setstate_c, sizeof(__pyx_k_TaosTopicAssignment___setstate_c), 0, 0, 1, 1}, + {&__pyx_n_s_TmqError, __pyx_k_TmqError, sizeof(__pyx_k_TmqError), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UNSIZED_TYPE, __pyx_k_UNSIZED_TYPE, sizeof(__pyx_k_UNSIZED_TYPE), 0, 0, 1, 1}, + {&__pyx_n_u_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 1, 0, 1}, + {&__pyx_n_s__101, __pyx_k__101, sizeof(__pyx_k__101), 0, 0, 1, 1}, + {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, + {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, + {&__pyx_kp_u__63, __pyx_k__63, sizeof(__pyx_k__63), 0, 1, 0, 0}, + {&__pyx_n_s__64, __pyx_k__64, sizeof(__pyx_k__64), 0, 0, 1, 1}, + {&__pyx_n_s_affected_rows, __pyx_k_affected_rows, sizeof(__pyx_k_affected_rows), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_asdict, __pyx_k_asdict, sizeof(__pyx_k_asdict), 0, 0, 1, 1}, + {&__pyx_n_s_assignment, __pyx_k_assignment, sizeof(__pyx_k_assignment), 0, 0, 1, 1}, + {&__pyx_n_s_assignment_ptr, __pyx_k_assignment_ptr, sizeof(__pyx_k_assignment_ptr), 0, 0, 1, 1}, + {&__pyx_n_s_astimezone, __pyx_k_astimezone, sizeof(__pyx_k_astimezone), 0, 0, 1, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_begin, __pyx_k_begin, sizeof(__pyx_k_begin), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_blocks, __pyx_k_blocks, sizeof(__pyx_k_blocks), 0, 0, 1, 1}, + {&__pyx_n_s_blocks_iter, __pyx_k_blocks_iter, sizeof(__pyx_k_blocks_iter), 0, 0, 1, 1}, + {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, + {&__pyx_kp_u_bytes_2, __pyx_k_bytes_2, sizeof(__pyx_k_bytes_2), 0, 1, 0, 0}, + {&__pyx_kp_u_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 1, 0, 0}, + {&__pyx_n_s_callback_2, __pyx_k_callback_2, sizeof(__pyx_k_callback_2), 0, 0, 1, 1}, + {&__pyx_n_s_check_conn_error, __pyx_k_check_conn_error, sizeof(__pyx_k_check_conn_error), 0, 0, 1, 1}, + {&__pyx_n_s_check_result_error, __pyx_k_check_result_error, sizeof(__pyx_k_check_result_error), 0, 0, 1, 1}, + {&__pyx_n_s_clear_result_set, __pyx_k_clear_result_set, sizeof(__pyx_k_clear_result_set), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_commit, __pyx_k_commit, sizeof(__pyx_k_commit), 0, 0, 1, 1}, + {&__pyx_n_s_committed, __pyx_k_committed, sizeof(__pyx_k_committed), 0, 0, 1, 1}, + {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1}, + {&__pyx_n_s_configs, __pyx_k_configs, sizeof(__pyx_k_configs), 0, 0, 1, 1}, + {&__pyx_n_s_connection, __pyx_k_connection, sizeof(__pyx_k_connection), 0, 0, 1, 1}, + {&__pyx_n_s_current_offset, __pyx_k_current_offset, sizeof(__pyx_k_current_offset), 0, 0, 1, 1}, + {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 0, 1, 1}, + {&__pyx_n_s_database_2, __pyx_k_database_2, sizeof(__pyx_k_database_2), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_datetime_epoch, __pyx_k_datetime_epoch, sizeof(__pyx_k_datetime_epoch), 0, 0, 1, 1}, + {&__pyx_n_s_db, __pyx_k_db, sizeof(__pyx_k_db), 0, 0, 1, 1}, + {&__pyx_n_s_db_2, __pyx_k_db_2, sizeof(__pyx_k_db_2), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, + {&__pyx_n_s_dict_row_cls, __pyx_k_dict_row_cls, sizeof(__pyx_k_dict_row_cls), 0, 0, 1, 1}, + {&__pyx_kp_s_dict_str_str, __pyx_k_dict_str_str, sizeof(__pyx_k_dict_str_str), 0, 0, 1, 0}, + {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, + {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, + {&__pyx_n_s_dt_epoch, __pyx_k_dt_epoch, sizeof(__pyx_k_dt_epoch), 0, 0, 1, 1}, + {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, + {&__pyx_n_s_errstr, __pyx_k_errstr, sizeof(__pyx_k_errstr), 0, 0, 1, 1}, + {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_fetch_all, __pyx_k_fetch_all, sizeof(__pyx_k_fetch_all), 0, 0, 1, 1}, + {&__pyx_n_s_fetch_all_into_dict, __pyx_k_fetch_all_into_dict, sizeof(__pyx_k_fetch_all_into_dict), 0, 0, 1, 1}, + {&__pyx_n_s_fetch_block, __pyx_k_fetch_block, sizeof(__pyx_k_fetch_block), 0, 0, 1, 1}, + {&__pyx_n_s_fetch_block_2, __pyx_k_fetch_block_2, sizeof(__pyx_k_fetch_block_2), 0, 0, 1, 1}, + {&__pyx_n_s_fetch_rows_a, __pyx_k_fetch_rows_a, sizeof(__pyx_k_fetch_rows_a), 0, 0, 1, 1}, + {&__pyx_n_s_fetchall, __pyx_k_fetchall, sizeof(__pyx_k_fetchall), 0, 0, 1, 1}, + {&__pyx_n_s_fetchone, __pyx_k_fetchone, sizeof(__pyx_k_fetchone), 0, 0, 1, 1}, + {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, + {&__pyx_n_s_field_names, __pyx_k_field_names, sizeof(__pyx_k_field_names), 0, 0, 1, 1}, + {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, + {&__pyx_n_s_fromtimestamp, __pyx_k_fromtimestamp, sizeof(__pyx_k_fromtimestamp), 0, 0, 1, 1}, + {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, + {&__pyx_n_s_get_db_name, __pyx_k_get_db_name, sizeof(__pyx_k_get_db_name), 0, 0, 1, 1}, + {&__pyx_n_s_get_table_vgroup_id, __pyx_k_get_table_vgroup_id, sizeof(__pyx_k_get_table_vgroup_id), 0, 0, 1, 1}, + {&__pyx_n_s_get_topic_assignment, __pyx_k_get_topic_assignment, sizeof(__pyx_k_get_topic_assignment), 0, 0, 1, 1}, + {&__pyx_n_s_get_topic_name, __pyx_k_get_topic_name, sizeof(__pyx_k_get_topic_name), 0, 0, 1, 1}, + {&__pyx_n_s_get_vgroup_id, __pyx_k_get_vgroup_id, sizeof(__pyx_k_get_vgroup_id), 0, 0, 1, 1}, + {&__pyx_n_s_get_vgroup_offset, __pyx_k_get_vgroup_offset, sizeof(__pyx_k_get_vgroup_offset), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init_conn, __pyx_k_init_conn, sizeof(__pyx_k_init_conn), 0, 0, 1, 1}, + {&__pyx_n_s_init_options, __pyx_k_init_options, sizeof(__pyx_k_init_options), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_s_is_null, __pyx_k_is_null, sizeof(__pyx_k_is_null), 0, 0, 1, 1}, + {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_k_2, __pyx_k_k_2, sizeof(__pyx_k_k_2), 0, 0, 1, 1}, + {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1}, + {&__pyx_kp_s_list_str, __pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 0, 1, 0}, + {&__pyx_n_s_load_table_info, __pyx_k_load_table_info, sizeof(__pyx_k_load_table_info), 0, 0, 1, 1}, + {&__pyx_n_s_localize, __pyx_k_localize, sizeof(__pyx_k_localize), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_num_of_assignment, __pyx_k_num_of_assignment, sizeof(__pyx_k_num_of_assignment), 0, 0, 1, 1}, + {&__pyx_n_s_num_of_rows, __pyx_k_num_of_rows, sizeof(__pyx_k_num_of_rows), 0, 0, 1, 1}, + {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, + {&__pyx_n_s_offset_commit, __pyx_k_offset_commit, sizeof(__pyx_k_offset_commit), 0, 0, 1, 1}, + {&__pyx_n_s_offset_seek, __pyx_k_offset_seek, sizeof(__pyx_k_offset_seek), 0, 0, 1, 1}, + {&__pyx_n_s_offsets, __pyx_k_offsets, sizeof(__pyx_k_offsets), 0, 0, 1, 1}, + {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, + {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1}, + {&__pyx_n_s_pblock, __pyx_k_pblock, sizeof(__pyx_k_pblock), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, + {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, + {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, + {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_priv_datetime_epoch, __pyx_k_priv_datetime_epoch, sizeof(__pyx_k_priv_datetime_epoch), 0, 0, 1, 1}, + {&__pyx_n_s_priv_tz, __pyx_k_priv_tz, sizeof(__pyx_k_priv_tz), 0, 0, 1, 1}, + {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_TaosCursor, __pyx_k_pyx_unpickle_TaosCursor, sizeof(__pyx_k_pyx_unpickle_TaosCursor), 0, 0, 1, 1}, + {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, + {&__pyx_n_s_query_a, __pyx_k_query_a, sizeof(__pyx_k_query_a), 0, 0, 1, 1}, + {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_req_id, __pyx_k_req_id, sizeof(__pyx_k_req_id), 0, 0, 1, 1}, + {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, + {&__pyx_n_s_reset_result, __pyx_k_reset_result, sizeof(__pyx_k_reset_result), 0, 0, 1, 1}, + {&__pyx_n_s_result_commit, __pyx_k_result_commit, sizeof(__pyx_k_result_commit), 0, 0, 1, 1}, + {&__pyx_n_s_rollback, __pyx_k_rollback, sizeof(__pyx_k_rollback), 0, 0, 1, 1}, + {&__pyx_n_u_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 1, 0, 1}, + {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1}, + {&__pyx_n_s_row_count, __pyx_k_row_count, sizeof(__pyx_k_row_count), 0, 0, 1, 1}, + {&__pyx_n_s_rows_iter, __pyx_k_rows_iter, sizeof(__pyx_k_rows_iter), 0, 0, 1, 1}, + {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, + {&__pyx_kp_u_select_database_error, __pyx_k_select_database_error, sizeof(__pyx_k_select_database_error), 0, 1, 0, 0}, + {&__pyx_n_s_select_db, __pyx_k_select_db, sizeof(__pyx_k_select_db), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_set_tz, __pyx_k_set_tz, sizeof(__pyx_k_set_tz), 0, 0, 1, 1}, + {&__pyx_kp_u_set_up_tmq_config_failed, __pyx_k_set_up_tmq_config_failed, sizeof(__pyx_k_set_up_tmq_config_failed), 0, 1, 0, 0}, + {&__pyx_kp_u_set_up_tmq_list_failed, __pyx_k_set_up_tmq_list_failed, sizeof(__pyx_k_set_up_tmq_list_failed), 0, 1, 0, 0}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_kp_u_setup_tmq_failed, __pyx_k_setup_tmq_failed, sizeof(__pyx_k_setup_tmq_failed), 0, 1, 0, 0}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_sql, __pyx_k_sql, sizeof(__pyx_k_sql), 0, 0, 1, 1}, + {&__pyx_n_s_sql_2, __pyx_k_sql_2, sizeof(__pyx_k_sql_2), 0, 0, 1, 1}, + {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_subscribe, __pyx_k_subscribe, sizeof(__pyx_k_subscribe), 0, 0, 1, 1}, + {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, + {&__pyx_n_s_table_2, __pyx_k_table_2, sizeof(__pyx_k_table_2), 0, 0, 1, 1}, + {&__pyx_n_s_tables, __pyx_k_tables, sizeof(__pyx_k_tables), 0, 0, 1, 1}, + {&__pyx_n_s_tables_2, __pyx_k_tables_2, sizeof(__pyx_k_tables_2), 0, 0, 1, 1}, + {&__pyx_n_s_taos__cinterface, __pyx_k_taos__cinterface, sizeof(__pyx_k_taos__cinterface), 0, 0, 1, 1}, + {&__pyx_n_s_taos__objects, __pyx_k_taos__objects, sizeof(__pyx_k_taos__objects), 0, 0, 1, 1}, + {&__pyx_kp_s_taos__objects_pyx, __pyx_k_taos__objects_pyx, sizeof(__pyx_k_taos__objects_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_taos_error, __pyx_k_taos_error, sizeof(__pyx_k_taos_error), 0, 0, 1, 1}, + {&__pyx_n_s_taos_fetch_raw_block_a, __pyx_k_taos_fetch_raw_block_a, sizeof(__pyx_k_taos_fetch_raw_block_a), 0, 0, 1, 1}, + {&__pyx_n_s_taos_res, __pyx_k_taos_res, sizeof(__pyx_k_taos_res), 0, 0, 1, 1}, + {&__pyx_n_s_taos_row, __pyx_k_taos_row, sizeof(__pyx_k_taos_row), 0, 0, 1, 1}, + {&__pyx_n_u_taosdata, __pyx_k_taosdata, sizeof(__pyx_k_taosdata), 0, 1, 0, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1}, + {&__pyx_n_s_tmq_conf, __pyx_k_tmq_conf, sizeof(__pyx_k_tmq_conf), 0, 0, 1, 1}, + {&__pyx_kp_u_tmq_conf_res, __pyx_k_tmq_conf_res, sizeof(__pyx_k_tmq_conf_res), 0, 1, 0, 0}, + {&__pyx_n_s_tmq_conf_res_2, __pyx_k_tmq_conf_res_2, sizeof(__pyx_k_tmq_conf_res_2), 0, 0, 1, 1}, + {&__pyx_n_s_tmq_errno, __pyx_k_tmq_errno, sizeof(__pyx_k_tmq_errno), 0, 0, 1, 1}, + {&__pyx_n_s_tmq_list, __pyx_k_tmq_list, sizeof(__pyx_k_tmq_list), 0, 0, 1, 1}, + {&__pyx_n_s_topic, __pyx_k_topic, sizeof(__pyx_k_topic), 0, 0, 1, 1}, + {&__pyx_n_s_topic_2, __pyx_k_topic_2, sizeof(__pyx_k_topic_2), 0, 0, 1, 1}, + {&__pyx_n_s_topic_assignments, __pyx_k_topic_assignments, sizeof(__pyx_k_topic_assignments), 0, 0, 1, 1}, + {&__pyx_n_s_topics, __pyx_k_topics, sizeof(__pyx_k_topics), 0, 0, 1, 1}, + {&__pyx_n_s_tp, __pyx_k_tp, sizeof(__pyx_k_tp), 0, 0, 1, 1}, + {&__pyx_n_s_tp_2, __pyx_k_tp_2, sizeof(__pyx_k_tp_2), 0, 0, 1, 1}, + {&__pyx_n_s_tta, __pyx_k_tta, sizeof(__pyx_k_tta), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_kp_u_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 1, 0, 0}, + {&__pyx_n_s_type_3, __pyx_k_type_3, sizeof(__pyx_k_type_3), 0, 0, 1, 1}, + {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, + {&__pyx_n_s_tz, __pyx_k_tz, sizeof(__pyx_k_tz), 0, 0, 1, 1}, + {&__pyx_n_s_unsubscribe, __pyx_k_unsubscribe, sizeof(__pyx_k_unsubscribe), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, + {&__pyx_n_s_utc_datetime_epoch, __pyx_k_utc_datetime_epoch, sizeof(__pyx_k_utc_datetime_epoch), 0, 0, 1, 1}, + {&__pyx_n_s_utc_tz, __pyx_k_utc_tz, sizeof(__pyx_k_utc_tz), 0, 0, 1, 1}, + {&__pyx_n_s_utcfromtimestamp, __pyx_k_utcfromtimestamp, sizeof(__pyx_k_utcfromtimestamp), 0, 0, 1, 1}, + {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_v_2, __pyx_k_v_2, sizeof(__pyx_k_v_2), 0, 0, 1, 1}, + {&__pyx_n_s_vg_id, __pyx_k_vg_id, sizeof(__pyx_k_vg_id), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 292, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "taos/_objects.pyx":519 + * tmq_conf_destroy(self._tmq_conf) + * self._tmq_conf = NULL + * raise Exception("set up tmq config failed!") # <<<<<<<<<<<<<< + * + * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_set_up_tmq_config_failed); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "taos/_objects.pyx":523 + * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) + * if self._tmq is NULL: + * raise Exception("setup tmq failed") # <<<<<<<<<<<<<< + * + * def subscribe(self, topics: list[str]): + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_setup_tmq_failed); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "taos/_objects.pyx":528 + * tmq_list = tmq_list_new() + * if tmq_list is NULL: + * raise Exception("set up tmq list failed!") # <<<<<<<<<<<<<< + * + * for tp in topics: + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_set_up_tmq_list_failed); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "(tree fragment)":4 + * cdef object __pyx_PickleError + * cdef object __pyx_result + * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum + */ + __pyx_tuple__62 = PyTuple_Pack(3, __pyx_int_126557407, __pyx_int_17084266, __pyx_int_199624353); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + + /* "taos/_objects.pyx":13 + * + * _priv_tz = None + * _utc_tz = pytz.timezone("UTC") # <<<<<<<<<<<<<< + * try: + * _datetime_epoch = dt.datetime.fromtimestamp(0) + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_u_UTC); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + + /* "taos/_objects.pyx":15 + * _utc_tz = pytz.timezone("UTC") + * try: + * _datetime_epoch = dt.datetime.fromtimestamp(0) # <<<<<<<<<<<<<< + * except OSError: + * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + + /* "taos/_objects.pyx":17 + * _datetime_epoch = dt.datetime.fromtimestamp(0) + * except OSError: + * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) # <<<<<<<<<<<<<< + * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) + * _priv_datetime_epoch = None + */ + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_int_86400); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + + /* "taos/_objects.pyx":22 + * + * + * def set_tz(tz): # <<<<<<<<<<<<<< + * global _priv_tz, _priv_datetime_epoch + * _priv_tz = tz + */ + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_set_tz, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 22, __pyx_L1_error) + + /* "taos/_objects.pyx":88 + * self._check_conn_error() + * + * def _init_options(self): # <<<<<<<<<<<<<< + * if self._tz: + * tz = self._tz + */ + __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_init_options, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 88, __pyx_L1_error) + + /* "taos/_objects.pyx":97 + * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + * + * def _init_conn(self): # <<<<<<<<<<<<<< + * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + * + */ + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_init_conn, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 97, __pyx_L1_error) + + /* "taos/_objects.pyx":100 + * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + * + * def _check_conn_error(self): # <<<<<<<<<<<<<< + * errno = taos_errno(self._raw_conn) + * if errno != 0: + */ + __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_errno, __pyx_n_s_errstr); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_check_conn_error, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 100, __pyx_L1_error) + + /* "taos/_objects.pyx":109 + * self.close() + * + * def close(self): # <<<<<<<<<<<<<< + * if self._raw_conn is not NULL: + * taos_close(self._raw_conn) + */ + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_close, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 109, __pyx_L1_error) + + /* "taos/_objects.pyx":125 + * return taos_get_server_info(self._raw_conn).decode("utf-8") + * + * def select_db(self, database: str): # <<<<<<<<<<<<<< + * _database = database.encode("utf-8") + * res = taos_select_db(self._raw_conn, _database) + */ + __pyx_tuple__72 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_database, __pyx_n_s_database_2, __pyx_n_s_res); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_select_db, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 125, __pyx_L1_error) + + /* "taos/_objects.pyx":131 + * raise DatabaseError("select database error", res) + * + * def execute(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * return self.query(sql, req_id).affected_rows + * + */ + __pyx_tuple__73 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sql, __pyx_n_s_req_id); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_execute, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_tuple__74 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); + + /* "taos/_objects.pyx":134 + * return self.query(sql, req_id).affected_rows + * + * def query(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * _sql = sql.encode("utf-8") + * if req_id is None: + */ + __pyx_tuple__75 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sql, __pyx_n_s_req_id, __pyx_n_s_sql_2, __pyx_n_s_res); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_query, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 134, __pyx_L1_error) + + /* "taos/_objects.pyx":143 + * return TaosResult(res) + * + * def query_a(self, sql: str, callback, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * _sql = sql.encode("utf-8") + * if req_id is None: + */ + __pyx_tuple__76 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sql, __pyx_n_s_callback_2, __pyx_n_s_req_id, __pyx_n_s_sql_2); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_query_a, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 143, __pyx_L1_error) + + /* "taos/_objects.pyx":150 + * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + * + * def subscribe(self, configs: dict[str, str], callback): # <<<<<<<<<<<<<< + * if self._raw_conn is NULL: + * return None + */ + __pyx_tuple__77 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_configs, __pyx_n_s_callback_2, __pyx_n_s_tmq_conf, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_k_2, __pyx_n_s_v_2, __pyx_n_s_tmq_conf_res_2); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_subscribe, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 150, __pyx_L1_error) + + /* "taos/_objects.pyx":161 + * print("tmq_conf_res:", tmq_conf_res) + * + * def load_table_info(self, tables: list): # <<<<<<<<<<<<<< + * # type: (str) -> None + * _tables = ",".join(tables).encode("utf-8") + */ + __pyx_tuple__78 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tables, __pyx_n_s_tables_2); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_load_table_info, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 161, __pyx_L1_error) + + /* "taos/_objects.pyx":166 + * taos_load_table_info(self._raw_conn, _tables) + * + * def commit(self): # <<<<<<<<<<<<<< + * """Commit any pending transaction to the database. + * + */ + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_commit, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 166, __pyx_L1_error) + + /* "taos/_objects.pyx":173 + * pass + * + * def rollback(self): # <<<<<<<<<<<<<< + * """Void functionality""" + * pass + */ + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_rollback, 173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 173, __pyx_L1_error) + + /* "taos/_objects.pyx":177 + * pass + * + * def clear_result_set(self): # <<<<<<<<<<<<<< + * """Clear unused result set on this connection.""" + * pass + */ + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_clear_result_set, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 177, __pyx_L1_error) + + /* "taos/_objects.pyx":181 + * pass + * + * def get_table_vgroup_id(self, db: str, table: str): # <<<<<<<<<<<<<< + * # type: (str, str) -> int + * """ + */ + __pyx_tuple__79 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_db, __pyx_n_s_table, __pyx_n_s_vg_id, __pyx_n_s_db_2, __pyx_n_s_table_2, __pyx_n_s_code); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_table_vgroup_id, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 181, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_tuple__80 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 3, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 3, __pyx_L1_error) + + /* "taos/_objects.pyx":277 + * return self._row_count + * + * def _check_result_error(self): # <<<<<<<<<<<<<< + * errno = taos_errno(self._res) + * if errno != 0: + */ + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_check_result_error, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 277, __pyx_L1_error) + + /* "taos/_objects.pyx":283 + * raise ProgrammingError(errstr, errno) + * + * def _fetch_block(self): # <<<<<<<<<<<<<< + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(self._res, &pblock) + */ + __pyx_tuple__81 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_pblock, __pyx_n_s_num_of_rows, __pyx_n_s_blocks, __pyx_n_s_dt_epoch, __pyx_n_s_i, __pyx_n_s_data, __pyx_n_s_field, __pyx_n_s_offsets, __pyx_n_s_is_null); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_block, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 283, __pyx_L1_error) + + /* "taos/_objects.pyx":310 + * return blocks, abs(num_of_rows) + * + * def fetch_block(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetch iterator") + */ + __pyx_tuple__82 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_num_of_rows, __pyx_n_s_r); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_block_2, 310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 310, __pyx_L1_error) + + /* "taos/_objects.pyx":319 + * return [r for r in map(tuple, zip(*block))], num_of_rows + * + * def fetch_all(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") + */ + __pyx_tuple__83 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_blocks, __pyx_n_s_block, __pyx_n_s_num_of_rows, __pyx_n_s_b, __pyx_n_s_r); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_all, 319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 319, __pyx_L1_error) + + /* "taos/_objects.pyx":336 + * return [r for b in blocks for r in map(tuple, zip(*b))] + * + * def fetch_all_into_dict(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") + */ + __pyx_tuple__84 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_field_names, __pyx_n_s_dict_row_cls, __pyx_n_s_blocks, __pyx_n_s_block, __pyx_n_s_num_of_rows, __pyx_n_s_field, __pyx_n_s_b, __pyx_n_s_r); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_all_into_dict, 336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 336, __pyx_L1_error) + + /* "taos/_objects.pyx":355 + * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] + * + * def rows_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ + __pyx_tuple__85 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_taos_row, __pyx_n_s_i, __pyx_n_s_dt_epoch, __pyx_n_s_is_null, __pyx_n_s_row, __pyx_n_s_data, __pyx_n_s_field); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_rows_iter, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 355, __pyx_L1_error) + + /* "taos/_objects.pyx":387 + * yield row + * + * def blocks_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_blocks_iter, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 387, __pyx_L1_error) + + /* "taos/_objects.pyx":399 + * yield [r for r in map(tuple, zip(*block))], num_of_rows + * + * def fetch_rows_a(self, callback): # <<<<<<<<<<<<<< + * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + * + */ + __pyx_tuple__86 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback_2); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_rows_a, 399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 399, __pyx_L1_error) + + /* "taos/_objects.pyx":402 + * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + * + * def taos_fetch_raw_block_a(self, callback): # <<<<<<<<<<<<<< + * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) + * + */ + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_taos_fetch_raw_block_a, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 402, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 3, __pyx_L1_error) + + /* "taos/_objects.pyx":441 + * return self._result.affected_rows + * + * def execute(self, sql, params=None, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * """Prepare and execute a database operation (query or command).""" + * if not self._connection: + */ + __pyx_tuple__87 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sql, __pyx_n_s_params, __pyx_n_s_req_id, __pyx_n_s_f); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_execute, 441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_tuple__88 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + + /* "taos/_objects.pyx":451 + * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] + * + * def fetchone(self): # <<<<<<<<<<<<<< + * return next(self) + * + */ + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetchone, 451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 451, __pyx_L1_error) + + /* "taos/_objects.pyx":454 + * return next(self) + * + * def fetchall(self): # <<<<<<<<<<<<<< + * return [r for r in self] + * + */ + __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetchall, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 454, __pyx_L1_error) + + /* "taos/_objects.pyx":457 + * return [r for r in self] + * + * def close(self): # <<<<<<<<<<<<<< + * if self._connection is None: + * return False + */ + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_close, 457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 457, __pyx_L1_error) + + /* "taos/_objects.pyx":466 + * return True + * + * def _reset_result(self): # <<<<<<<<<<<<<< + * """Reset the result to unused version.""" + * self._description = [] + */ + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_reset_result, 466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 466, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + __pyx_tuple__90 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) + */ + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 16, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 3, __pyx_L1_error) + + /* "taos/_objects.pyx":525 + * raise Exception("setup tmq failed") + * + * def subscribe(self, topics: list[str]): # <<<<<<<<<<<<<< + * tmq_list = tmq_list_new() + * if tmq_list is NULL: + */ + __pyx_tuple__91 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_topics, __pyx_n_s_tmq_list, __pyx_n_s_tp, __pyx_n_s_tp_2, __pyx_n_s_tmq_errno); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_subscribe, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 525, __pyx_L1_error) + + /* "taos/_objects.pyx":542 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def unsubscribe(self): # <<<<<<<<<<<<<< + * tmq_errno = tmq_unsubscribe(self._tmq) + * if tmq_errno != 0: + */ + __pyx_tuple__92 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tmq_errno); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_unsubscribe, 542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 542, __pyx_L1_error) + + /* "taos/_objects.pyx":547 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def poll(self, timeout: int): # <<<<<<<<<<<<<< + * res = tmq_consumer_poll(self._tmq, timeout) + * if res is NULL: + */ + __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_timeout, __pyx_n_s_res); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_poll, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 547, __pyx_L1_error) + + /* "taos/_objects.pyx":554 + * return TaosResult(res) + * + * def commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * self.result_commit(taos_res) + * + */ + __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_taos_res); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_commit, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 554, __pyx_L1_error) + + /* "taos/_objects.pyx":557 + * self.result_commit(taos_res) + * + * def result_commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) + * if tmq_errno != 0: + */ + __pyx_tuple__95 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_taos_res, __pyx_n_s_tmq_errno); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_result_commit, 557, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 557, __pyx_L1_error) + + /* "taos/_objects.pyx":562 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def offset_commit(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + */ + __pyx_tuple__96 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_topic, __pyx_n_s_vg_id, __pyx_n_s_offset, __pyx_n_s_topic_2, __pyx_n_s_tmq_errno); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__96); + __Pyx_GIVEREF(__pyx_tuple__96); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_offset_commit, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 562, __pyx_L1_error) + + /* "taos/_objects.pyx":568 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def get_topic_assignment(self, topic: str): # <<<<<<<<<<<<<< + * cdef int32_t num_of_assignment + * cdef tmq_topic_assignment *assignment_ptr = NULL + */ + __pyx_tuple__97 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_topic, __pyx_n_s_num_of_assignment, __pyx_n_s_assignment_ptr, __pyx_n_s_topic_2, __pyx_n_s_tmq_errno, __pyx_n_s_assignment, __pyx_n_s_topic_assignments, __pyx_n_s_i, __pyx_n_s_tta); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_topic_assignment, 568, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 568, __pyx_L1_error) + + /* "taos/_objects.pyx":588 + * return topic_assignments + * + * def offset_seek(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + */ + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_offset_seek, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 588, __pyx_L1_error) + + /* "taos/_objects.pyx":594 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def position(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * pos = tmq_position(self._tmq, _topic, vg_id) + */ + __pyx_tuple__98 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_topic, __pyx_n_s_vg_id, __pyx_n_s_topic_2, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__98); + __Pyx_GIVEREF(__pyx_tuple__98); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_position, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 594, __pyx_L1_error) + + /* "taos/_objects.pyx":602 + * return pos + * + * def committed(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * offset = tmq_committed(self._tmq, _topic, vg_id) + */ + __pyx_tuple__99 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_topic, __pyx_n_s_vg_id, __pyx_n_s_topic_2, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_committed, 602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 602, __pyx_L1_error) + + /* "taos/_objects.pyx":613 + * return offset + * + * def get_topic_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_topic_name(taos_res._res) + * + */ + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_topic_name, 613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 613, __pyx_L1_error) + + /* "taos/_objects.pyx":616 + * return tmq_get_topic_name(taos_res._res) + * + * def get_db_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_db_name(taos_res._res) + * + */ + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_db_name, 616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 616, __pyx_L1_error) + + /* "taos/_objects.pyx":619 + * return tmq_get_db_name(taos_res._res) + * + * def get_vgroup_id(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_vgroup_id(taos_res._res) + * + */ + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_vgroup_id, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 619, __pyx_L1_error) + + /* "taos/_objects.pyx":622 + * return tmq_get_vgroup_id(taos_res._res) + * + * def get_vgroup_offset(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_vgroup_offset(taos_res._res) + * + */ + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_vgroup_offset, 622, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 622, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 3, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_tuple__100 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__100); + __Pyx_GIVEREF(__pyx_tuple__100); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TaosCursor, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_86400 = PyInt_FromLong(86400L); if (unlikely(!__pyx_int_86400)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_17084266 = PyInt_FromLong(17084266L); if (unlikely(!__pyx_int_17084266)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_126557407 = PyInt_FromLong(126557407L); if (unlikely(!__pyx_int_126557407)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_199624353 = PyInt_FromLong(199624353L); if (unlikely(!__pyx_int_199624353)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4taos_8_objects_TaosConnection = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosConnection_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosConnection)) __PYX_ERR(0, 46, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosConnection_spec, __pyx_ptype_4taos_8_objects_TaosConnection) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + #else + __pyx_ptype_4taos_8_objects_TaosConnection = &__pyx_type_4taos_8_objects_TaosConnection; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosConnection) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4taos_8_objects_TaosConnection->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosConnection->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosConnection->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4taos_8_objects_TaosConnection->tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #endif + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosConnection, (PyObject *) __pyx_ptype_4taos_8_objects_TaosConnection) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosConnection) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4taos_8_objects_TaosField = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosField_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosField)) __PYX_ERR(0, 195, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosField_spec, __pyx_ptype_4taos_8_objects_TaosField) < 0) __PYX_ERR(0, 195, __pyx_L1_error) + #else + __pyx_ptype_4taos_8_objects_TaosField = &__pyx_type_4taos_8_objects_TaosField; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosField) < 0) __PYX_ERR(0, 195, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4taos_8_objects_TaosField->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosField->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosField->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4taos_8_objects_TaosField->tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #endif + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosField, (PyObject *) __pyx_ptype_4taos_8_objects_TaosField) < 0) __PYX_ERR(0, 195, __pyx_L1_error) + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosField) < 0) __PYX_ERR(0, 195, __pyx_L1_error) + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4taos_8_objects_TaosResult = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosResult_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosResult)) __PYX_ERR(0, 231, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosResult_spec, __pyx_ptype_4taos_8_objects_TaosResult) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + #else + __pyx_ptype_4taos_8_objects_TaosResult = &__pyx_type_4taos_8_objects_TaosResult; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosResult) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4taos_8_objects_TaosResult->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosResult->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosResult->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4taos_8_objects_TaosResult->tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #endif + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosResult, (PyObject *) __pyx_ptype_4taos_8_objects_TaosResult) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosResult) < 0) __PYX_ERR(0, 231, __pyx_L1_error) + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4taos_8_objects_TaosCursor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosCursor_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosCursor)) __PYX_ERR(0, 413, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosCursor_spec, __pyx_ptype_4taos_8_objects_TaosCursor) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + #else + __pyx_ptype_4taos_8_objects_TaosCursor = &__pyx_type_4taos_8_objects_TaosCursor; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosCursor) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4taos_8_objects_TaosCursor->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosCursor->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosCursor->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4taos_8_objects_TaosCursor->tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #endif + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosCursor, (PyObject *) __pyx_ptype_4taos_8_objects_TaosCursor) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosCursor) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4taos_8_objects_TaosTopicAssignment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosTopicAssignment_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosTopicAssignment)) __PYX_ERR(0, 475, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosTopicAssignment_spec, __pyx_ptype_4taos_8_objects_TaosTopicAssignment) < 0) __PYX_ERR(0, 475, __pyx_L1_error) + #else + __pyx_ptype_4taos_8_objects_TaosTopicAssignment = &__pyx_type_4taos_8_objects_TaosTopicAssignment; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosTopicAssignment) < 0) __PYX_ERR(0, 475, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4taos_8_objects_TaosTopicAssignment->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosTopicAssignment->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosTopicAssignment->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4taos_8_objects_TaosTopicAssignment->tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #endif + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosTopicAssignment, (PyObject *) __pyx_ptype_4taos_8_objects_TaosTopicAssignment) < 0) __PYX_ERR(0, 475, __pyx_L1_error) + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosTopicAssignment) < 0) __PYX_ERR(0, 475, __pyx_L1_error) + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4taos_8_objects_TaosConsumer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosConsumer_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosConsumer)) __PYX_ERR(0, 504, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosConsumer_spec, __pyx_ptype_4taos_8_objects_TaosConsumer) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + #else + __pyx_ptype_4taos_8_objects_TaosConsumer = &__pyx_type_4taos_8_objects_TaosConsumer; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosConsumer) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4taos_8_objects_TaosConsumer->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosConsumer->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4taos_8_objects_TaosConsumer->tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #endif + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosConsumer, (PyObject *) __pyx_ptype_4taos_8_objects_TaosConsumer) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosConsumer) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter)) __PYX_ERR(0, 355, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_spec, __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter) < 0) __PYX_ERR(0, 355, __pyx_L1_error) + #else + __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter = &__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter) < 0) __PYX_ERR(0, 355, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter->tp_dictoffset && __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter)) __PYX_ERR(0, 387, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_spec, __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + #else + __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter = &__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter->tp_dictoffset && __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__)) __PYX_ERR(0, 423, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___spec, __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(0, 423, __pyx_L1_error) + #else + __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__ = &__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(0, 423, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__->tp_dictoffset && __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("taos._cinterface"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "taos_get_column_data_is_null", (void (**)(void))&__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null, "PyObject *(TAOS_RES *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "taos_fetch_block_v3", (void (**)(void))&__pyx_f_4taos_11_cinterface_taos_fetch_block_v3, "PyObject *(TAOS_RES *, TAOS_FIELD *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("taos._parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_binary_string", (void (**)(void))&__pyx_f_4taos_7_parser__parse_binary_string, "PyObject *(size_t, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_nchar_string", (void (**)(void))&__pyx_f_4taos_7_parser__parse_nchar_string, "PyObject *(size_t, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_string", (void (**)(void))&__pyx_f_4taos_7_parser__parse_string, "PyObject *(size_t, int, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_timestamp", (void (**)(void))&__pyx_f_4taos_7_parser__parse_timestamp, "PyObject *(size_t, int, PyObject *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__objects(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__objects}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_objects", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_objects(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_objects(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__objects(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__objects(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__objects(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + __Pyx_TraceDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_objects' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_objects", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to _objects pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__objects(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_taos___objects) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "taos._objects")) { + if (unlikely((PyDict_SetItemString(modules, "taos._objects", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__objects(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); + + /* "taos/_objects.pyx":3 + * # cython: profile=True + * + * from typing import Optional # <<<<<<<<<<<<<< + * from taos._cinterface cimport * + * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Optional); + __Pyx_GIVEREF(__pyx_n_s_Optional); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Optional); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":6 + * from taos._cinterface cimport * + * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string + * from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC # <<<<<<<<<<<<<< + * import datetime as dt + * import pytz + */ + __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_SIZED_TYPE); + __Pyx_GIVEREF(__pyx_n_s_SIZED_TYPE); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SIZED_TYPE); + __Pyx_INCREF(__pyx_n_s_UNSIZED_TYPE); + __Pyx_GIVEREF(__pyx_n_s_UNSIZED_TYPE); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_UNSIZED_TYPE); + __Pyx_INCREF(__pyx_n_s_CONVERT_FUNC); + __Pyx_GIVEREF(__pyx_n_s_CONVERT_FUNC); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_CONVERT_FUNC); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_taos__cinterface, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIZED_TYPE, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_UNSIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNSIZED_TYPE, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CONVERT_FUNC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONVERT_FUNC, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":7 + * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string + * from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC + * import datetime as dt # <<<<<<<<<<<<<< + * import pytz + * from collections import namedtuple + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":8 + * from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC + * import datetime as dt + * import pytz # <<<<<<<<<<<<<< + * from collections import namedtuple + * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pytz, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":9 + * import datetime as dt + * import pytz + * from collections import namedtuple # <<<<<<<<<<<<<< + * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_namedtuple); + __Pyx_GIVEREF(__pyx_n_s_namedtuple); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":10 + * import pytz + * from collections import namedtuple + * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError # <<<<<<<<<<<<<< + * + * _priv_tz = None + */ + __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_ProgrammingError); + __Pyx_GIVEREF(__pyx_n_s_ProgrammingError); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ProgrammingError); + __Pyx_INCREF(__pyx_n_s_OperationalError); + __Pyx_GIVEREF(__pyx_n_s_OperationalError); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_OperationalError); + __Pyx_INCREF(__pyx_n_s_ConnectionError); + __Pyx_GIVEREF(__pyx_n_s_ConnectionError); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ConnectionError); + __Pyx_INCREF(__pyx_n_s_DatabaseError); + __Pyx_GIVEREF(__pyx_n_s_DatabaseError); + PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_DatabaseError); + __Pyx_INCREF(__pyx_n_s_StatementError); + __Pyx_GIVEREF(__pyx_n_s_StatementError); + PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_StatementError); + __Pyx_INCREF(__pyx_n_s_InternalError); + __Pyx_GIVEREF(__pyx_n_s_InternalError); + PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_InternalError); + __Pyx_INCREF(__pyx_n_s_TmqError); + __Pyx_GIVEREF(__pyx_n_s_TmqError); + PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_TmqError); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_taos_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProgrammingError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_OperationalError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConnectionError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DatabaseError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StatementError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_StatementError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InternalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InternalError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TmqError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":12 + * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError + * + * _priv_tz = None # <<<<<<<<<<<<<< + * _utc_tz = pytz.timezone("UTC") + * try: + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_priv_tz, Py_None) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + + /* "taos/_objects.pyx":13 + * + * _priv_tz = None + * _utc_tz = pytz.timezone("UTC") # <<<<<<<<<<<<<< + * try: + * _datetime_epoch = dt.datetime.fromtimestamp(0) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pytz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timezone); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc_tz, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_objects.pyx":14 + * _priv_tz = None + * _utc_tz = pytz.timezone("UTC") + * try: # <<<<<<<<<<<<<< + * _datetime_epoch = dt.datetime.fromtimestamp(0) + * except OSError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "taos/_objects.pyx":15 + * _utc_tz = pytz.timezone("UTC") + * try: + * _datetime_epoch = dt.datetime.fromtimestamp(0) # <<<<<<<<<<<<<< + * except OSError: + * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fromtimestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_epoch, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":14 + * _priv_tz = None + * _utc_tz = pytz.timezone("UTC") + * try: # <<<<<<<<<<<<<< + * _datetime_epoch = dt.datetime.fromtimestamp(0) + * except OSError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L7_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":16 + * try: + * _datetime_epoch = dt.datetime.fromtimestamp(0) + * except OSError: # <<<<<<<<<<<<<< + * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) + * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) + */ + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError); + if (__pyx_t_6) { + __Pyx_AddTraceback("taos._objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 16, __pyx_L4_except_error) + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_7); + + /* "taos/_objects.pyx":17 + * _datetime_epoch = dt.datetime.fromtimestamp(0) + * except OSError: + * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) # <<<<<<<<<<<<<< + * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) + * _priv_datetime_epoch = None + */ + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_dt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_fromtimestamp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_dt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_seconds, __pyx_int_86400) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Subtract(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_epoch, __pyx_t_8) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + + /* "taos/_objects.pyx":14 + * _priv_tz = None + * _utc_tz = pytz.timezone("UTC") + * try: # <<<<<<<<<<<<<< + * _datetime_epoch = dt.datetime.fromtimestamp(0) + * except OSError: + */ + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); + __pyx_L7_try_end:; + } + + /* "taos/_objects.pyx":18 + * except OSError: + * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) + * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) # <<<<<<<<<<<<<< + * _priv_datetime_epoch = None + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_utc_tz); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_localize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_dt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_utcfromtimestamp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc_datetime_epoch, __pyx_t_7) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "taos/_objects.pyx":19 + * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) + * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) + * _priv_datetime_epoch = None # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_priv_datetime_epoch, Py_None) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + + /* "taos/_objects.pyx":22 + * + * + * def set_tz(tz): # <<<<<<<<<<<<<< + * global _priv_tz, _priv_datetime_epoch + * _priv_tz = tz + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_1set_tz, 0, __pyx_n_s_set_tz, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_tz, __pyx_t_7) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "taos/_objects.pyx":88 + * self._check_conn_error() + * + * def _init_options(self): # <<<<<<<<<<<<<< + * if self._tz: + * tz = self._tz + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_3_init_options, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection__init_options, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_init_options, __pyx_t_7) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":97 + * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + * + * def _init_conn(self): # <<<<<<<<<<<<<< + * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + * + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_5_init_conn, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection__init_conn, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_init_conn, __pyx_t_7) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":100 + * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) + * + * def _check_conn_error(self): # <<<<<<<<<<<<<< + * errno = taos_errno(self._raw_conn) + * if errno != 0: + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_7_check_conn_error, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection__check_conn_error, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_check_conn_error, __pyx_t_7) < 0) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":109 + * self.close() + * + * def close(self): # <<<<<<<<<<<<<< + * if self._raw_conn is not NULL: + * taos_close(self._raw_conn) + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_11close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_close, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_close, __pyx_t_7) < 0) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":125 + * return taos_get_server_info(self._raw_conn).decode("utf-8") + * + * def select_db(self, database: str): # <<<<<<<<<<<<<< + * _database = database.encode("utf-8") + * res = taos_select_db(self._raw_conn, _database) + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_database, __pyx_n_s_str) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_13select_db, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_select_db, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_select_db, __pyx_t_3) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":131 + * raise DatabaseError("select database error", res) + * + * def execute(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * return self.query(sql, req_id).affected_rows + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sql, __pyx_n_s_str) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_req_id, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_15execute, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_execute, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__74); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_execute, __pyx_t_7) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":134 + * return self.query(sql, req_id).affected_rows + * + * def query(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * _sql = sql.encode("utf-8") + * if req_id is None: + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_sql, __pyx_n_s_str) < 0) __PYX_ERR(0, 134, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_req_id, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_17query, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_query, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__74); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":143 + * return TaosResult(res) + * + * def query_a(self, sql: str, callback, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * _sql = sql.encode("utf-8") + * if req_id is None: + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sql, __pyx_n_s_str) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_req_id, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_19query_a, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_query_a, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__74); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_query_a, __pyx_t_7) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":150 + * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + * + * def subscribe(self, configs: dict[str, str], callback): # <<<<<<<<<<<<<< + * if self._raw_conn is NULL: + * return None + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_configs, __pyx_kp_s_dict_str_str) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_21subscribe, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_subscribe, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_subscribe, __pyx_t_3) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":161 + * print("tmq_conf_res:", tmq_conf_res) + * + * def load_table_info(self, tables: list): # <<<<<<<<<<<<<< + * # type: (str) -> None + * _tables = ",".join(tables).encode("utf-8") + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tables, __pyx_n_s_list) < 0) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_23load_table_info, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_load_table_info, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_load_table_info, __pyx_t_7) < 0) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":166 + * taos_load_table_info(self._raw_conn, _tables) + * + * def commit(self): # <<<<<<<<<<<<<< + * """Commit any pending transaction to the database. + * + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_25commit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_commit, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_commit, __pyx_t_7) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":173 + * pass + * + * def rollback(self): # <<<<<<<<<<<<<< + * """Void functionality""" + * pass + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_27rollback, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_rollback, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_rollback, __pyx_t_7) < 0) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":177 + * pass + * + * def clear_result_set(self): # <<<<<<<<<<<<<< + * """Clear unused result set on this connection.""" + * pass + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_29clear_result_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_clear_result_set, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_clear_result_set, __pyx_t_7) < 0) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "taos/_objects.pyx":181 + * pass + * + * def get_table_vgroup_id(self, db: str, table: str): # <<<<<<<<<<<<<< + * # type: (str, str) -> int + * """ + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_db, __pyx_n_s_str) < 0) __PYX_ERR(0, 181, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_table, __pyx_n_s_str) < 0) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_31get_table_vgroup_id, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_get_table_vgroup, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_get_table_vgroup_id, __pyx_t_3) < 0) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_9TaosField_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosField___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_9TaosField_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosField___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":277 + * return self._row_count + * + * def _check_result_error(self): # <<<<<<<<<<<<<< + * errno = taos_errno(self._res) + * if errno != 0: + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_9_check_result_error, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult__check_result_error, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_check_result_error, __pyx_t_3) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); + + /* "taos/_objects.pyx":283 + * raise ProgrammingError(errstr, errno) + * + * def _fetch_block(self): # <<<<<<<<<<<<<< + * cdef TAOS_ROW pblock + * num_of_rows = taos_fetch_block(self._res, &pblock) + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_11_fetch_block, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult__fetch_block, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_block, __pyx_t_3) < 0) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); + + /* "taos/_objects.pyx":310 + * return blocks, abs(num_of_rows) + * + * def fetch_block(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetch iterator") + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_13fetch_block, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_fetch_block, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_block_2, __pyx_t_3) < 0) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); + + /* "taos/_objects.pyx":319 + * return [r for r in map(tuple, zip(*block))], num_of_rows + * + * def fetch_all(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_15fetch_all, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_fetch_all, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_all, __pyx_t_3) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); + + /* "taos/_objects.pyx":336 + * return [r for b in blocks for r in map(tuple, zip(*b))] + * + * def fetch_all_into_dict(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of fetchall") + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_17fetch_all_into_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_fetch_all_into_dict, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_all_into_dict, __pyx_t_3) < 0) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); + + /* "taos/_objects.pyx":355 + * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] + * + * def rows_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_19rows_iter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_rows_iter, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_rows_iter, __pyx_t_3) < 0) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); + + /* "taos/_objects.pyx":387 + * yield row + * + * def blocks_iter(self): # <<<<<<<<<<<<<< + * if self._res is NULL: + * raise OperationalError("Invalid use of rows_iter") + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_22blocks_iter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_blocks_iter, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_blocks_iter, __pyx_t_3) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); + + /* "taos/_objects.pyx":399 + * yield [r for r in map(tuple, zip(*block))], num_of_rows + * + * def fetch_rows_a(self, callback): # <<<<<<<<<<<<<< + * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + * + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_25fetch_rows_a, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_fetch_rows_a, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_rows_a, __pyx_t_3) < 0) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); + + /* "taos/_objects.pyx":402 + * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + * + * def taos_fetch_raw_block_a(self, callback): # <<<<<<<<<<<<<< + * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) + * + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_taos_fetch_raw_block, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_taos_fetch_raw_block_a, __pyx_t_3) < 0) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_31__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_33__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":441 + * return self._result.affected_rows + * + * def execute(self, sql, params=None, req_id: Optional[int] = None): # <<<<<<<<<<<<<< + * """Prepare and execute a database operation (query or command).""" + * if not self._connection: + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_req_id, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_6execute, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor_execute, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__88); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_execute, __pyx_t_7) < 0) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); + + /* "taos/_objects.pyx":451 + * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] + * + * def fetchone(self): # <<<<<<<<<<<<<< + * return next(self) + * + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_8fetchone, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor_fetchone, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_fetchone, __pyx_t_7) < 0) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); + + /* "taos/_objects.pyx":454 + * return next(self) + * + * def fetchall(self): # <<<<<<<<<<<<<< + * return [r for r in self] + * + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_10fetchall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor_fetchall, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_fetchall, __pyx_t_7) < 0) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); + + /* "taos/_objects.pyx":457 + * return [r for r in self] + * + * def close(self): # <<<<<<<<<<<<<< + * if self._connection is None: + * return False + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_12close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor_close, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_close, __pyx_t_7) < 0) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); + + /* "taos/_objects.pyx":466 + * return True + * + * def _reset_result(self): # <<<<<<<<<<<<<< + * """Reset the result to unused version.""" + * self._description = [] + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_14_reset_result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor__reset_result, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_reset_result, __pyx_t_7) < 0) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef tuple state + * cdef object _dict + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_18__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); + + /* "(tree fragment)":16 + * else: + * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_20__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(1, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosTopicAssignment___reduce_cyt, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosTopicAssignment___setstate_c, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "taos/_objects.pyx":525 + * raise Exception("setup tmq failed") + * + * def subscribe(self, topics: list[str]): # <<<<<<<<<<<<<< + * tmq_list = tmq_list_new() + * if tmq_list is NULL: + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_topics, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_3subscribe, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_subscribe, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_subscribe, __pyx_t_3) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":542 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def unsubscribe(self): # <<<<<<<<<<<<<< + * tmq_errno = tmq_unsubscribe(self._tmq) + * if tmq_errno != 0: + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_5unsubscribe, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_unsubscribe, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_unsubscribe, __pyx_t_3) < 0) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":547 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def poll(self, timeout: int): # <<<<<<<<<<<<<< + * res = tmq_consumer_poll(self._tmq, timeout) + * if res is NULL: + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_timeout, __pyx_n_s_int) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_7poll, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_poll, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_poll, __pyx_t_7) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":554 + * return TaosResult(res) + * + * def commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * self.result_commit(taos_res) + * + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_9commit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_commit, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_commit, __pyx_t_3) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":557 + * self.result_commit(taos_res) + * + * def result_commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) + * if tmq_errno != 0: + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_11result_commit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_result_commit, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_result_commit, __pyx_t_7) < 0) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":562 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def offset_commit(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vg_id, __pyx_n_s_int) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_offset, __pyx_n_s_int) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_13offset_commit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_offset_commit, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_offset_commit, __pyx_t_3) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":568 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def get_topic_assignment(self, topic: str): # <<<<<<<<<<<<<< + * cdef int32_t num_of_assignment + * cdef tmq_topic_assignment *assignment_ptr = NULL + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_15get_topic_assignment, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_topic_assignmen, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_topic_assignment, __pyx_t_7) < 0) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":588 + * return topic_assignments + * + * def offset_seek(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vg_id, __pyx_n_s_int) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_offset, __pyx_n_s_int) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_17offset_seek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_offset_seek, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_offset_seek, __pyx_t_3) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":594 + * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + * + * def position(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * pos = tmq_position(self._tmq, _topic, vg_id) + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 594, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vg_id, __pyx_n_s_int) < 0) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_19position, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_position, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_position, __pyx_t_7) < 0) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":602 + * return pos + * + * def committed(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< + * _topic = topic.encode("utf-8") + * offset = tmq_committed(self._tmq, _topic, vg_id) + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 602, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vg_id, __pyx_n_s_int) < 0) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_21committed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_committed, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_committed, __pyx_t_3) < 0) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":613 + * return offset + * + * def get_topic_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_topic_name(taos_res._res) + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_23get_topic_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_topic_name, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_topic_name, __pyx_t_7) < 0) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":616 + * return tmq_get_topic_name(taos_res._res) + * + * def get_db_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_db_name(taos_res._res) + * + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_25get_db_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_db_name, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_db_name, __pyx_t_3) < 0) __PYX_ERR(0, 616, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":619 + * return tmq_get_db_name(taos_res._res) + * + * def get_vgroup_id(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_vgroup_id(taos_res._res) + * + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 619, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_27get_vgroup_id, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_vgroup_id, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_vgroup_id, __pyx_t_7) < 0) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "taos/_objects.pyx":622 + * return tmq_get_vgroup_id(taos_res._res) + * + * def get_vgroup_offset(self, taos_res: TaosResult): # <<<<<<<<<<<<<< + * return tmq_get_vgroup_offset(taos_res._res) + * + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 622, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_29get_vgroup_offset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_vgroup_offset, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_vgroup_offset, __pyx_t_3) < 0) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * cdef object __pyx_PickleError + * cdef object __pyx_result + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_3__pyx_unpickle_TaosCursor, 0, __pyx_n_s_pyx_unpickle_TaosCursor, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TaosCursor, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "taos/_objects.pyx":1 + * # cython: profile=True # <<<<<<<<<<<<<< + * + * from typing import Optional + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_TraceReturn(Py_None, 0); + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init taos._objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init taos._objects"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; // error + return kwvalues[i]; + } + } + return NULL; // not found (no exception set) +} +#endif + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + if (kwds_is_tuple) { + if (pos >= PyTuple_GET_SIZE(kwds)) break; + key = PyTuple_GET_ITEM(kwds, pos); + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* Profile */ +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + PyThreadState* tstate, + const char *funcname, + const char *srcfile, + int firstlineno) { + PyObject *type, *value, *traceback; + int retval; + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); + retval = 1; + __Pyx_EnterTracing(tstate); + __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); + #if CYTHON_TRACE + if (tstate->c_tracefunc) + retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; + if (retval && tstate->c_profilefunc) + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + __Pyx_LeaveTracing(tstate); + if (retval) { + __Pyx_ErrRestoreInState(tstate, type, value, traceback); + return __Pyx_IsTracing(tstate, 0, 0) && retval; + } else { + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(traceback); + return -1; + } +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyCodeObject *py_code = 0; +#if PY_MAJOR_VERSION >= 3 + py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); + if (likely(py_code)) { + py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; + } +#else + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + py_funcname = PyString_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + py_srcfile = PyString_FromString(srcfile); + if (unlikely(!py_srcfile)) goto bad; + py_code = PyCode_New( + 0, + 0, + 0, + CO_OPTIMIZED | CO_NEWLOCALS, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); +#endif + return py_code; +} +#endif + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]); + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + Py_DECREF(argstuple); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) + if (__Pyx_IsCyOrPyCFunction(func)) +#else + if (PyCFunction_Check(func)) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + } + else if (nargs == 1 && kwargs == NULL) { + if (PyCFunction_Check(func)) + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, args[0]); + } + } + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + #if CYTHON_VECTORCALL + vectorcallfunc f = _PyVectorcall_Function(func); + if (f) { + return f(func, args, (size_t)nargs, kwargs); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, kwargs); + } + #endif + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); +} + +/* decode_c_bytes */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( + const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + if (unlikely((start < 0) | (stop < 0))) { + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (stop > length) + stop = length; + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return -1; + __Pyx_PyErr_Clear(); + return 0; + } + return 0; +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } + return __Pyx_IterFinish(); +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + __Pyx_PyThreadState_declare + CYTHON_UNUSED_VAR(cause); + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + #if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kw, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { + if (unlikely(PyTuple_GET_SIZE(kw) == 0)) + return 1; + if (!kw_allowed) { + key = PyTuple_GET_ITEM(kw, 0); + goto invalid_keyword; + } +#if PY_VERSION_HEX < 0x03090000 + for (pos = 0; pos < PyTuple_GET_SIZE(kw); pos++) { + key = PyTuple_GET_ITEM(kw, pos); + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } +#endif + return 1; + } + while (PyDict_Next(kw, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if (!kw_allowed && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); + else state = (PyGILState_STATE)0; +#endif + CYTHON_UNUSED_VAR(clineno); + CYTHON_UNUSED_VAR(lineno); + CYTHON_UNUSED_VAR(filename); + CYTHON_MAYBE_UNUSED_VAR(nogil); + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* decode_c_string */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg = NULL; + return __Pyx_PyObject_FastCall(func, (&arg)+1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + __Pyx_TypeName type_name; + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR + if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) +#elif PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (likely(descr != NULL)) { + *method = descr; + return 0; + } + type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* UnpackTupleError */ +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +/* UnpackTuple2 */ +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { + PyObject *value1 = NULL, *value2 = NULL; +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); + value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); +#endif + if (decref_tuple) { + Py_DECREF(tuple); + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +#if CYTHON_COMPILING_IN_PYPY +bad: + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +#endif +} +static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = __Pyx_PyObject_GetIterNextFunc(iter); + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +/* dict_iter */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; + if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + PyObject **pp = NULL; + if (method_name) { + const char *name = PyUnicode_AsUTF8(method_name); + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } + } +#endif + } + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next( + PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +/* PyObjectFormatAndDecref */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { + if (unlikely(!s)) return NULL; + if (likely(PyUnicode_CheckExact(s))) return s; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(s))) { + PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); + Py_DECREF(s); + return result; + } + #endif + return __Pyx_PyObject_FormatAndDecref(s, f); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { + PyObject *result = PyObject_Format(s, f); + Py_DECREF(s); + return result; +} + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + CYTHON_MAYBE_UNUSED_VAR(max_char); +#if CYTHON_PEP393_ENABLED + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); +#else + result_uval = PyUnicode_FromUnicode(NULL, result_ulength); + if (unlikely(!result_uval)) return NULL; + result_ukind = sizeof(Py_UNICODE); + kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; + result_udata = PyUnicode_AS_UNICODE(result_uval); +#endif + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); + if (unlikely(__Pyx_PyUnicode_READY(uval))) + goto bad; + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + } else { + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + CYTHON_UNUSED_VAR(value_count); + return PyUnicode_Join(__pyx_empty_unicode, value_tuple); +#endif +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* CIntToDigits */ +static const char DIGIT_PAIRS_10[2*10*10+1] = { + "00010203040506070809" + "10111213141516171819" + "20212223242526272829" + "30313233343536373839" + "40414243444546474849" + "50515253545556575859" + "60616263646566676869" + "70717273747576777879" + "80818283848586878889" + "90919293949596979899" +}; +static const char DIGIT_PAIRS_8[2*8*8+1] = { + "0001020304050607" + "1011121314151617" + "2021222324252627" + "3031323334353637" + "4041424344454647" + "5051525354555657" + "6061626364656667" + "7071727374757677" +}; +static const char DIGITS_HEX[2*16+1] = { + "0123456789abcdef" + "0123456789ABCDEF" +}; + +/* BuildPyUnicode */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, + int prepend_sign, char padding_char) { + PyObject *uval; + Py_ssize_t uoffset = ulength - clength; +#if CYTHON_USE_UNICODE_INTERNALS + Py_ssize_t i; +#if CYTHON_PEP393_ENABLED + void *udata; + uval = PyUnicode_New(ulength, 127); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_DATA(uval); +#else + Py_UNICODE *udata; + uval = PyUnicode_FromUnicode(NULL, ulength); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_AS_UNICODE(uval); +#endif + if (uoffset > 0) { + i = 0; + if (prepend_sign) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); + i++; + } + for (; i < uoffset; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); + } + } + for (i=0; i < clength; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + } +#else + { + PyObject *sign = NULL, *padding = NULL; + uval = NULL; + if (uoffset > 0) { + prepend_sign = !!prepend_sign; + if (uoffset > prepend_sign) { + padding = PyUnicode_FromOrdinal(padding_char); + if (likely(padding) && uoffset > prepend_sign + 1) { + PyObject *tmp; + PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); + if (unlikely(!repeat)) goto done_or_error; + tmp = PyNumber_Multiply(padding, repeat); + Py_DECREF(repeat); + Py_DECREF(padding); + padding = tmp; + } + if (unlikely(!padding)) goto done_or_error; + } + if (prepend_sign) { + sign = PyUnicode_FromOrdinal('-'); + if (unlikely(!sign)) goto done_or_error; + } + } + uval = PyUnicode_DecodeASCII(chars, clength, NULL); + if (likely(uval) && padding) { + PyObject *tmp = PyNumber_Add(padding, uval); + Py_DECREF(uval); + uval = tmp; + } + if (likely(uval) && sign) { + PyObject *tmp = PyNumber_Add(sign, uval); + Py_DECREF(uval); + uval = tmp; + } +done_or_error: + Py_XDECREF(padding); + Py_XDECREF(sign); + } +#endif + return uval; +} + +/* CIntToPyUnicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(size_t)*3+2]; + char *dpos, *end = digits + sizeof(size_t)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + size_t remaining; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (size_t) (remaining / (8*8)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (size_t) (remaining / (10*10)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (size_t) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + assert(!last_one_off || *dpos == '0'); + dpos += last_one_off; + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + +/* PyIntCompare */ +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(inplace); + if (op1 == op2) { + return 1; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + return (a == b); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + if (intval == 0) { + return (__Pyx_PyLong_IsZero(op1) == 1); + } else if (intval < 0) { + if (__Pyx_PyLong_IsNonNeg(op1)) + return 0; + intval = -intval; + } else { + if (__Pyx_PyLong_IsNeg(op1)) + return 0; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + return (unequal == 0); + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + return ((double)a == (double)b); + } + return __Pyx_PyObject_IsTrueAndDecref( + PyObject_RichCompare(op1, op2, Py_EQ)); +} + +/* SetItemInt */ +static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { + int r; + if (unlikely(!j)) return -1; + r = PyObject_SetItem(o, j, v); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, + CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { + PyObject* old = PyList_GET_ITEM(o, n); + Py_INCREF(v); + PyList_SET_ITEM(o, n, v); + Py_DECREF(old); + return 1; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_ass_subscript) { + int r; + PyObject *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return -1; + r = mm->mp_ass_subscript(o, key, v); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_ass_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return -1; + PyErr_Clear(); + } + } + return sm->sq_ass_item(o, i, v); + } + } +#else +#if CYTHON_COMPILING_IN_PYPY + if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) +#else + if (is_list || PySequence_Check(o)) +#endif + { + return PySequence_SetItem(o, i, v); + } +#endif + return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* py_abs */ +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { +#if PY_VERSION_HEX >= 0x030C00A7 + if (likely(__Pyx_PyLong_IsCompact(n))) { + return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n)); + } +#else + if (likely(Py_SIZE(n) == -1)) { + return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]); + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *copy = _PyLong_Copy((PyLongObject*)n); + if (likely(copy)) { + #if PY_VERSION_HEX >= 0x030C00A7 + ((PyLongObject*)copy)->long_value.lv_tag = ((PyLongObject*)copy)->long_value.lv_tag & ~_PyLong_SIGN_MASK; + #else + __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); + #endif + } + return copy; + } +#else + return PyNumber_Negative(n); +#endif +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* pep479 */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { + PyObject *exc, *val, *tb, *cur_exc; + __Pyx_PyThreadState_declare + #ifdef __Pyx_StopAsyncIteration_USED + int is_async_stopiteration = 0; + #endif + CYTHON_MAYBE_UNUSED_VAR(in_async_gen); + cur_exc = PyErr_Occurred(); + if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { + #ifdef __Pyx_StopAsyncIteration_USED + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + is_async_stopiteration = 1; + } else + #endif + return; + } + __Pyx_PyThreadState_assign + __Pyx_GetException(&exc, &val, &tb); + Py_XDECREF(exc); + Py_XDECREF(val); + Py_XDECREF(tb); + PyErr_SetString(PyExc_RuntimeError, + #ifdef __Pyx_StopAsyncIteration_USED + is_async_stopiteration ? "async generator raised StopAsyncIteration" : + in_async_gen ? "async generator raised StopIteration" : + #endif + "generator raised StopIteration"); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + __Pyx_TypeName obj_type_name; + __Pyx_TypeName type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + type_name = __Pyx_PyType_GetName(type); + PyErr_Format(PyExc_TypeError, + "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, + obj_type_name, type_name); + __Pyx_DECREF_TypeName(obj_type_name); + __Pyx_DECREF_TypeName(type_name); + return 0; +} + +/* IterNext */ +static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { + PyObject* exc_type; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(defval); + return defval; + } + if (defval) { + Py_INCREF(defval); + return defval; + } + __Pyx_PyErr_SetNone(PyExc_StopIteration); + return NULL; +} +static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { + __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetName(Py_TYPE(iterator)); + PyErr_Format(PyExc_TypeError, + __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name); + __Pyx_DECREF_TypeName(iterator_type_name); +} +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { + PyObject* next; + iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; + if (likely(iternext)) { +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + next = iternext(iterator); + if (likely(next)) + return next; +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(iternext == &_PyObject_NextNotImplemented)) + return NULL; +#endif +#else + next = PyIter_Next(iterator); + if (likely(next)) + return next; +#endif + } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { + __Pyx_PyIter_Next_ErrorNoIterator(iterator); + return NULL; + } +#if !CYTHON_USE_TYPE_SLOTS + else { + next = PyIter_Next(iterator); + if (likely(next)) + return next; + } +#endif + return __Pyx_PyIter_Next2Default(defval); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r; +#if CYTHON_USE_TYPE_SLOTS + if (likely(PyString_Check(n))) { + r = __Pyx_PyObject_GetAttrStrNoError(o, n); + if (unlikely(!r) && likely(!PyErr_Occurred())) { + r = __Pyx_NewRef(d); + } + return r; + } +#endif + r = PyObject_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* RaiseUnexpectedTypeError */ +static int +__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) +{ + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, + expected, obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, 1); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + #endif + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__63); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (!r) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* ValidateBasesTuple */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { + Py_ssize_t i, n = PyTuple_GET_SIZE(bases); + for (i = 1; i < n; i++) + { + PyObject *b0 = PyTuple_GET_ITEM(bases, i); + PyTypeObject *b; +#if PY_MAJOR_VERSION < 3 + if (PyClass_Check(b0)) + { + PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", + PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); + return -1; + } +#endif + b = (PyTypeObject*) b0; + if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); + __Pyx_DECREF_TypeName(b_name); + return -1; + } + if (dictoffset == 0 && b->tp_dictoffset) + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + return -1; + } + } + return 0; +} +#endif + +/* PyType_Ready */ +static int __Pyx_PyType_Ready(PyTypeObject *t) { +#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) + (void)__Pyx_PyObject_CallMethod0; +#if CYTHON_USE_TYPE_SPECS + (void)__Pyx_validate_bases_tuple; +#endif + return PyType_Ready(t); +#else + int r; + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) + return -1; +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + { + int gc_was_enabled; + #if PY_VERSION_HEX >= 0x030A00b1 + gc_was_enabled = PyGC_Disable(); + (void)__Pyx_PyObject_CallMethod0; + #else + PyObject *ret, *py_status; + PyObject *gc = NULL; + #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) + gc = PyImport_GetModule(__pyx_kp_u_gc); + #endif + if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) return -1; + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + if (unlikely(!py_status)) { + Py_DECREF(gc); + return -1; + } + gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); + Py_DECREF(py_status); + if (gc_was_enabled > 0) { + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + if (unlikely(!ret)) { + Py_DECREF(gc); + return -1; + } + Py_DECREF(ret); + } else if (unlikely(gc_was_enabled == -1)) { + Py_DECREF(gc); + return -1; + } + #endif + t->tp_flags |= Py_TPFLAGS_HEAPTYPE; +#if PY_VERSION_HEX >= 0x030A0000 + t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; +#endif +#else + (void)__Pyx_PyObject_CallMethod0; +#endif + r = PyType_Ready(t); +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; + #if PY_VERSION_HEX >= 0x030A00b1 + if (gc_was_enabled) + PyGC_Enable(); + #else + if (gc_was_enabled) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + if (likely(ret || r == -1)) { + Py_XDECREF(ret); + PyErr_Restore(tp, v, tb); + } else { + Py_XDECREF(tp); + Py_XDECREF(v); + Py_XDECREF(tb); + r = -1; + } + } + Py_DECREF(gc); + #endif + } +#endif + return r; +#endif +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, attr_name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(attr_name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetupReduce */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_getstate = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + PyObject *getstate = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); +#else + getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); + if (!getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } +#endif + if (getstate) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); +#else + object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); + if (!object_getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } +#endif + if (object_getstate != getstate) { + goto __PYX_GOOD; + } + } +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) { + __Pyx_TypeName type_obj_name = + __Pyx_PyType_GetName((PyTypeObject*)type_obj); + PyErr_Format(PyExc_RuntimeError, + "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); + __Pyx_DECREF_TypeName(type_obj_name); + } + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); + Py_XDECREF(object_getstate); + Py_XDECREF(getstate); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} +#endif + +/* ImportDottedModule */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s__64; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); + if (unlikely(!abi_module)) return NULL; + Py_INCREF(abi_module); + return abi_module; +} + +/* FetchCommonType */ +static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); + PyList_SET_ITEM(fromlist, 0, marker); + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyCFunctionObject *cf = (PyCFunctionObject*) op; + if (unlikely(op == NULL)) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + cf->m_ml = ml; + cf->m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + cf->m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(((PyCFunctionObject*)m)->m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(((PyCFunctionObject*)m)->m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#ifdef _Py_TPFLAGS_HAVE_VECTORCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + _PyTraceback_Add(funcname, filename, py_line); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE int8_t __Pyx_PyInt_As_int8_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int8_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int8_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int8_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int8_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int8_t) >= 2 * PyLong_SHIFT)) { + return (int8_t) (((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int8_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int8_t) >= 3 * PyLong_SHIFT)) { + return (int8_t) (((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int8_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int8_t) >= 4 * PyLong_SHIFT)) { + return (int8_t) (((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int8_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int8_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int8_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT)) { + return (int8_t) (((int8_t)-1)*(((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int8_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT)) { + return (int8_t) ((((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT)) { + return (int8_t) (((int8_t)-1)*(((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int8_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT)) { + return (int8_t) ((((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT)) { + return (int8_t) (((int8_t)-1)*(((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int8_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT)) { + return (int8_t) ((((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int8_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int8_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int8_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int8_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int8_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int8_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int8_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int8_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int8_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int8_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int8_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int8_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int8_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int8_t) 1) << (sizeof(int8_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int8_t) -1; + } + } else { + int8_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int8_t) -1; + val = __Pyx_PyInt_As_int8_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int8_t"); + return (int8_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int8_t"); + return (int8_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int32_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int32_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) { + return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) { + return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) { + return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int32_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int32_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { + return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { + return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { + return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { + return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { + return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { + return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int32_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int32_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int32_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int32_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int32_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int32_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int32_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int32_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int32_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int32_t) -1; + } + } else { + int32_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int32_t) -1; + val = __Pyx_PyInt_As_int32_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int32_t"); + return (int32_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int32_t"); + return (int32_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(size_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(size_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(size_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (size_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (size_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (size_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (size_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((size_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((size_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int64_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int64_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) { + return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) { + return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) { + return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int64_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int64_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { + return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { + return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { + return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { + return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { + return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { + return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int64_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int64_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int64_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int64_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int64_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int64_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int64_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int64_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int64_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int64_t) -1; + } + } else { + int64_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int64_t) -1; + val = __Pyx_PyInt_As_int64_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int64_t"); + return (int64_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int64_t"); + return (int64_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int8_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int8_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int8_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int8_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int32_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int32_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int32_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int32_t), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(uint16_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (uint16_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT)) { + return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT)) { + return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT)) { + return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (uint16_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(uint16_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { + return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { + return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { + return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { + return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { + return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { + return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(uint16_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(uint16_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + uint16_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (uint16_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (uint16_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (uint16_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (uint16_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (uint16_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(uint16_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((uint16_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(uint16_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((uint16_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((uint16_t) 1) << (sizeof(uint16_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (uint16_t) -1; + } + } else { + uint16_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (uint16_t) -1; + val = __Pyx_PyInt_As_uint16_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to uint16_t"); + return (uint16_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to uint16_t"); + return (uint16_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int64_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int64_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int64_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int64_t), + little, !is_unsigned); + } +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name_2); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__101)); + } + return name; +} +#endif + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_value = exc_info->exc_value; + exc_info->exc_value = *value; + if (tmp_value == NULL || tmp_value == Py_None) { + Py_XDECREF(tmp_value); + tmp_value = NULL; + tmp_type = NULL; + tmp_tb = NULL; + } else { + tmp_type = (PyObject*) Py_TYPE(tmp_value); + Py_INCREF(tmp_type); + #if CYTHON_COMPILING_IN_CPYTHON + tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; + Py_XINCREF(tmp_tb); + #else + tmp_tb = PyException_GetTraceback(tmp_value); + #endif + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args[3] = {NULL, arg1, arg2}; + return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* CoroutineBase */ +#include +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + CYTHON_UNUSED_VAR(__pyx_tstate); + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (likely(et == PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + value = Py_None; + } +#if PY_VERSION_HEX >= 0x030300A0 + else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); + } +#endif + else if (unlikely(PyTuple_Check(ev))) { + if (PyTuple_GET_SIZE(ev) >= 1) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + value = PyTuple_GET_ITEM(ev, 0); + Py_INCREF(value); +#else + value = PySequence_ITEM(ev, 0); +#endif + } else { + Py_INCREF(Py_None); + value = Py_None; + } + Py_DECREF(ev); + } + else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { + value = ev; + } + if (likely(value)) { + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = value; + return 0; + } + } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PySequence_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +static CYTHON_INLINE +void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_CLEAR(exc_state->exc_value); +#else + PyObject *t, *v, *tb; + t = exc_state->exc_type; + v = exc_state->exc_value; + tb = exc_state->exc_traceback; + exc_state->exc_type = NULL; + exc_state->exc_value = NULL; + exc_state->exc_traceback = NULL; + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); +#endif +} +#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { + msg = "coroutine already executing"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { + msg = "async generator already executing"; + #endif + } else { + msg = "generator already executing"; + } + PyErr_SetString(PyExc_ValueError, msg); +} +#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { + const char *msg; + CYTHON_MAYBE_UNUSED_VAR(gen); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(gen)) { + msg = "can't send non-None value to a just-started coroutine"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(gen)) { + msg = "can't send non-None value to a just-started async generator"; + #endif + } else { + msg = "can't send non-None value to a just-started generator"; + } + PyErr_SetString(PyExc_TypeError, msg); +} +#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { + CYTHON_MAYBE_UNUSED_VAR(gen); + CYTHON_MAYBE_UNUSED_VAR(closing); + #ifdef __Pyx_Coroutine_USED + if (!closing && __Pyx_Coroutine_Check(gen)) { + PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); + } else + #endif + if (value) { + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + else + #endif + PyErr_SetNone(PyExc_StopIteration); + } +} +static +PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { + __Pyx_PyThreadState_declare + PyThreadState *tstate; + __Pyx_ExcInfoStruct *exc_state; + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + return __Pyx_Coroutine_NotStartedError((PyObject*)self); + } + } + if (unlikely(self->resume_label == -1)) { + return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + } +#if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + tstate = __pyx_tstate; +#else + tstate = __Pyx_PyThreadState_Current; +#endif + exc_state = &self->gi_exc_state; + if (exc_state->exc_value) { + #if CYTHON_COMPILING_IN_PYPY + #else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #elif PY_VERSION_HEX >= 0x030B00a4 + exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; + #else + exc_tb = exc_state->exc_traceback; + #endif + if (exc_tb) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + assert(f->f_back == NULL); + #if PY_VERSION_HEX >= 0x030B00A1 + f->f_back = PyThreadState_GetFrame(tstate); + #else + Py_XINCREF(tstate->frame); + f->f_back = tstate->frame; + #endif + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON + Py_DECREF(exc_tb); + #endif + } + #endif + } +#if CYTHON_USE_EXC_INFO_STACK + exc_state->previous_item = tstate->exc_info; + tstate->exc_info = exc_state; +#else + if (exc_state->exc_type) { + __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } else { + __Pyx_Coroutine_ExceptionClear(exc_state); + __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } +#endif + self->is_running = 1; + retval = self->body(self, tstate, value); + self->is_running = 0; +#if CYTHON_USE_EXC_INFO_STACK + exc_state = &self->gi_exc_state; + tstate->exc_info = exc_state->previous_item; + exc_state->previous_item = NULL; + __Pyx_Coroutine_ResetFrameBackpointer(exc_state); +#endif + return retval; +} +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { +#if CYTHON_COMPILING_IN_PYPY + CYTHON_UNUSED_VAR(exc_state); +#else + PyObject *exc_tb; + #if PY_VERSION_HEX >= 0x030B00a4 + if (!exc_state->exc_value) return; + exc_tb = PyException_GetTraceback(exc_state->exc_value); + #else + exc_tb = exc_state->exc_traceback; + #endif + if (likely(exc_tb)) { + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + #if PY_VERSION_HEX >= 0x030B00a4 + Py_DECREF(exc_tb); + #endif + } +#endif +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { + CYTHON_MAYBE_UNUSED_VAR(gen); + if (unlikely(!retval)) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + PyObject *exc = PyExc_StopIteration; + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + exc = __Pyx_PyExc_StopAsyncIteration; + #endif + __Pyx_PyErr_SetNone(exc); + } + } + return retval; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +static CYTHON_INLINE +PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { +#if PY_VERSION_HEX <= 0x030A00A1 + return _PyGen_Send(gen, arg); +#else + PyObject *result; + if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { + if (PyAsyncGen_CheckExact(gen)) { + assert(result == Py_None); + PyErr_SetNone(PyExc_StopAsyncIteration); + } + else if (result == Py_None) { + PyErr_SetNone(PyExc_StopIteration); + } + else { + _PyGen_SetStopIterationValue(result); + } + Py_CLEAR(result); + } + return result; +#endif +} +#endif +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Coroutine_Undelegate(gen); + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); + ret = __Pyx_Coroutine_SendEx(gen, val, 0); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + ret = __Pyx_async_gen_asend_send(yf, value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyCoro_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + { + if (value == Py_None) + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + retval = __Pyx_Coroutine_FinishDelegation(gen); + } else { + retval = __Pyx_Coroutine_SendEx(gen, value, 0); + } + return __Pyx_Coroutine_MethodReturn(self, retval); +} +static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + if (__Pyx_CoroutineAwait_CheckExact(yf)) { + retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + retval = __Pyx_async_gen_asend_close(yf, NULL); + } else + if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { + retval = __Pyx_async_gen_athrow_close(yf, NULL); + } else + #endif + { + PyObject *meth; + gen->is_running = 1; + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (unlikely(PyErr_Occurred())) { + PyErr_WriteUnraisable(yf); + } + } else { + retval = __Pyx_PyObject_CallNoArg(meth); + Py_DECREF(meth); + if (unlikely(!retval)) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Next(yf); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, Py_None); + } else + #endif + ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_SendEx(gen, Py_None, 0); +} +static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + CYTHON_UNUSED_VAR(arg); + return __Pyx_Coroutine_Close(self); +} +static PyObject *__Pyx_Coroutine_Close(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + Py_INCREF(yf); + err = __Pyx_Coroutine_CloseIter(gen, yf); + __Pyx_Coroutine_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) + PyErr_SetNone(PyExc_GeneratorExit); + retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); + if (unlikely(retval)) { + const char *msg; + Py_DECREF(retval); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(self)) { + msg = "coroutine ignored GeneratorExit"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(self)) { +#if PY_VERSION_HEX < 0x03060000 + msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; +#else + msg = "async generator ignored GeneratorExit"; +#endif + #endif + } else { + msg = "generator ignored GeneratorExit"; + } + PyErr_SetString(PyExc_RuntimeError, msg); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { + if (raised_exception) PyErr_Clear(); + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, + PyObject *args, int close_on_genexit) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + Py_INCREF(yf); + if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { + int err = __Pyx_Coroutine_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Coroutine_Undelegate(gen); + if (err < 0) + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto throw_here; + } + gen->is_running = 1; + if (0 + #ifdef __Pyx_Generator_USED + || __Pyx_Generator_CheckExact(yf) + #endif + #ifdef __Pyx_Coroutine_USED + || __Pyx_Coroutine_Check(yf) + #endif + ) { + ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { + ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); + #endif + } else { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (unlikely(PyErr_Occurred())) { + gen->is_running = 0; + return NULL; + } + __Pyx_Coroutine_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + if (likely(args)) { + ret = __Pyx_PyObject_Call(meth, args, NULL); + } else { + PyObject *cargs[4] = {NULL, typ, val, tb}; + ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_MethodReturn(self, ret); + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +} +static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { + PyObject *typ; + PyObject *val = NULL; + PyObject *tb = NULL; + if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + return NULL; + return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); +} +static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { +#if PY_VERSION_HEX >= 0x030B00a4 + Py_VISIT(exc_state->exc_value); +#else + Py_VISIT(exc_state->exc_type); + Py_VISIT(exc_state->exc_value); + Py_VISIT(exc_state->exc_traceback); +#endif + return 0; +} +static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); +} +static int __Pyx_Coroutine_clear(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); + } +#endif + Py_CLEAR(gen->gi_code); + Py_CLEAR(gen->gi_frame); + Py_CLEAR(gen->gi_name); + Py_CLEAR(gen->gi_qualname); + Py_CLEAR(gen->gi_modulename); + return 0; +} +static void __Pyx_Coroutine_dealloc(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label >= 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE + if (unlikely(PyObject_CallFinalizerFromDealloc(self))) +#else + Py_TYPE(gen)->tp_del(self); + if (unlikely(Py_REFCNT(self) > 0)) +#endif + { + return; + } + PyObject_GC_UnTrack(self); + } +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + /* We have to handle this case for asynchronous generators + right here, because this code has to be between UNTRACK + and GC_Del. */ + Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); + } +#endif + __Pyx_Coroutine_clear(self); + __Pyx_PyHeapTypeObject_GC_Del(gen); +} +static void __Pyx_Coroutine_del(PyObject *self) { + PyObject *error_type, *error_value, *error_traceback; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + __Pyx_PyThreadState_declare + if (gen->resume_label < 0) { + return; + } +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt == 0); + __Pyx_SET_REFCNT(self, 1); +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; + PyObject *finalizer = agen->ag_finalizer; + if (finalizer && !agen->ag_closed) { + PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); + if (unlikely(!res)) { + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); + return; + } + } +#endif + if (unlikely(gen->resume_label == 0 && !error_value)) { +#ifdef __Pyx_Coroutine_USED +#ifdef __Pyx_Generator_USED + if (!__Pyx_Generator_CheckExact(self)) +#endif + { + PyObject_GC_UnTrack(self); +#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) + if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) + PyErr_WriteUnraisable(self); +#else + {PyObject *msg; + char *cmsg; + #if CYTHON_COMPILING_IN_PYPY + msg = NULL; + cmsg = (char*) "coroutine was never awaited"; + #else + char *cname; + PyObject *qualname; + qualname = gen->gi_qualname; + cname = PyString_AS_STRING(qualname); + msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); + if (unlikely(!msg)) { + PyErr_Clear(); + cmsg = (char*) "coroutine was never awaited"; + } else { + cmsg = PyString_AS_STRING(msg); + } + #endif + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) + PyErr_WriteUnraisable(self); + Py_XDECREF(msg);} +#endif + PyObject_GC_Track(self); + } +#endif + } else { + PyObject *res = __Pyx_Coroutine_Close(self); + if (unlikely(!res)) { + if (PyErr_Occurred()) + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if !CYTHON_USE_TP_FINALIZE + assert(Py_REFCNT(self) > 0); + if (likely(--self->ob_refcnt == 0)) { + return; + } + { + Py_ssize_t refcnt = Py_REFCNT(self); + _Py_NewReference(self); + __Pyx_SET_REFCNT(self, refcnt); + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(Py_TYPE(self)) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + _Py_DEC_REFTOTAL; +#endif +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyObject * +__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_name; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_name, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) +{ + PyObject *name = self->gi_qualname; + CYTHON_UNUSED_VAR(context); + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(self->gi_qualname, value); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) +{ + PyObject *frame = self->gi_frame; + CYTHON_UNUSED_VAR(context); + if (!frame) { + if (unlikely(!self->gi_code)) { + Py_RETURN_NONE; + } + frame = (PyObject *) PyFrame_New( + PyThreadState_Get(), /*PyThreadState *tstate,*/ + (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (unlikely(!frame)) + return NULL; + self->gi_frame = frame; + } + Py_INCREF(frame); + return frame; +} +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); + if (unlikely(!gen)) + return NULL; + return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); +} +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 + gen->gi_exc_state.exc_value = NULL; + #else + gen->gi_exc_state.exc_type = NULL; + gen->gi_exc_state.exc_value = NULL; + gen->gi_exc_state.exc_traceback = NULL; + #endif +#if CYTHON_USE_EXC_INFO_STACK + gen->gi_exc_state.previous_item = NULL; +#endif + gen->gi_weakreflist = NULL; + Py_XINCREF(qualname); + gen->gi_qualname = qualname; + Py_XINCREF(name); + gen->gi_name = name; + Py_XINCREF(module_name); + gen->gi_modulename = module_name; + Py_XINCREF(code); + gen->gi_code = code; + gen->gi_frame = NULL; + PyObject_GC_Track(gen); + return gen; +} + +/* PatchModuleWithCoroutine */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + int result; + PyObject *globals, *result_obj; + globals = PyDict_New(); if (unlikely(!globals)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_coroutine_type", + #ifdef __Pyx_Coroutine_USED + (PyObject*)__pyx_CoroutineType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_generator_type", + #ifdef __Pyx_Generator_USED + (PyObject*)__pyx_GeneratorType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; + result_obj = PyRun_String(py_code, Py_file_input, globals, globals); + if (unlikely(!result_obj)) goto ignore; + Py_DECREF(result_obj); + Py_DECREF(globals); + return module; +ignore: + Py_XDECREF(globals); + PyErr_WriteUnraisable(module); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { + Py_DECREF(module); + module = NULL; + } +#else + py_code++; +#endif + return module; +} + +/* PatchGeneratorABC */ +#ifndef CYTHON_REGISTER_ABCS +#define CYTHON_REGISTER_ABCS 1 +#endif +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +static PyObject* __Pyx_patch_abc_module(PyObject *module); +static PyObject* __Pyx_patch_abc_module(PyObject *module) { + module = __Pyx_Coroutine_patch_module( + module, "" +"if _cython_generator_type is not None:\n" +" try: Generator = _module.Generator\n" +" except AttributeError: pass\n" +" else: Generator.register(_cython_generator_type)\n" +"if _cython_coroutine_type is not None:\n" +" try: Coroutine = _module.Coroutine\n" +" except AttributeError: pass\n" +" else: Coroutine.register(_cython_coroutine_type)\n" + ); + return module; +} +#endif +static int __Pyx_patch_abc(void) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + static int abc_patched = 0; + if (CYTHON_REGISTER_ABCS && !abc_patched) { + PyObject *module; + module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); + if (unlikely(!module)) { + PyErr_WriteUnraisable(NULL); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, + ((PY_MAJOR_VERSION >= 3) ? + "Cython module failed to register with collections.abc module" : + "Cython module failed to register with collections module"), 1) < 0)) { + return -1; + } + } else { + module = __Pyx_patch_abc_module(module); + abc_patched = 1; + if (unlikely(!module)) + return -1; + Py_DECREF(module); + } + module = PyImport_ImportModule("backports_abc"); + if (module) { + module = __Pyx_patch_abc_module(module); + Py_XDECREF(module); + } + if (!module) { + PyErr_Clear(); + } + } +#else + if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); +#endif + return 0; +} + +/* Generator */ +static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, + (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, + {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if CYTHON_USE_TYPE_SPECS + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + (char*) PyDoc_STR("name of the generator"), 0}, + {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + (char*) PyDoc_STR("qualified name of the generator"), 0}, + {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + (char*) PyDoc_STR("Frame of the generator"), 0}, + {0, 0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_GeneratorType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, + {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, + {Py_tp_iter, (void *)PyObject_SelfIter}, + {Py_tp_iternext, (void *)__Pyx_Generator_Next}, + {Py_tp_methods, (void *)__pyx_Generator_methods}, + {Py_tp_members, (void *)__pyx_Generator_memberlist}, + {Py_tp_getset, (void *)__pyx_Generator_getsets}, + {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, +#if CYTHON_USE_TP_FINALIZE + {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif + {0, 0}, +}; +static PyType_Spec __pyx_GeneratorType_spec = { + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + __pyx_GeneratorType_slots +}; +#else +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "generator", + sizeof(__pyx_CoroutineObject), + 0, + (destructor) __Pyx_Coroutine_dealloc, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + 0, + (traverseproc) __Pyx_Coroutine_traverse, + 0, + 0, + offsetof(__pyx_CoroutineObject, gi_weakreflist), + 0, + (iternextfunc) __Pyx_Generator_Next, + __pyx_Generator_methods, + __pyx_Generator_memberlist, + __pyx_Generator_getsets, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if CYTHON_USE_TP_FINALIZE + 0, +#else + __Pyx_Coroutine_del, +#endif + 0, +#if CYTHON_USE_TP_FINALIZE + __Pyx_Coroutine_del, +#elif PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_Generator_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); +#endif + if (unlikely(!__pyx_GeneratorType)) { + return -1; + } + return 0; +} + +/* CheckBinaryVersion */ +static int __Pyx_check_binary_version(void) { + char ctversion[5]; + int same=1, i, found_dot; + const char* rt_from_call = Py_GetVersion(); + PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + found_dot = 0; + for (i = 0; i < 4; i++) { + if (!ctversion[i]) { + same = (rt_from_call[i] < '0' || rt_from_call[i] > '9'); + break; + } + if (rt_from_call[i] != ctversion[i]) { + same = 0; + break; + } + } + if (!same) { + char rtversion[5] = {'\0'}; + char message[200]; + for (i=0; i<4; ++i) { + if (rt_from_call[i] == '.') { + if (found_dot) break; + found_dot = 1; + } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { + break; + } + rtversion[i] = rt_from_call[i]; + } + PyOS_snprintf(message, sizeof(message), + "compile time version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction_3_0_0 +#define __PYX_HAVE_RT_ImportFunction_3_0_0 +static int __Pyx_ImportFunction_3_0_0(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 44cb92ab..bafddb9e 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -1,12 +1,13 @@ # cython: profile=True +from typing import Optional from taos._cinterface cimport * -from taos._parser cimport * +from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC import datetime as dt import pytz from collections import namedtuple -from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError +from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError _priv_tz = None _utc_tz = pytz.timezone("UTC") @@ -23,6 +24,7 @@ def set_tz(tz): _priv_tz = tz _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) + cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: with gil: callback = param @@ -54,30 +56,30 @@ cdef class TaosConnection: def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): if host: host = host.encode("utf-8") - self._host = host + self._host = host if user: user = user.encode("utf-8") - self._user = user + self._user = user if password: password = password.encode("utf-8") - self._password = password + self._password = password if database: database =database.encode("utf-8") - self._database = database + self._database = database if port: self._port = port if timezone: timezone = timezone.encode("utf-8") - self._tz = timezone + self._tz = timezone if config: config = config.encode("utf-8") - self._config = config + self._config = config self._init_options() self._init_conn() @@ -111,18 +113,18 @@ cdef class TaosConnection: @property def client_info(self): - return (taos_get_client_info()).decode("utf-8") + return taos_get_client_info().decode("utf-8") @property def server_info(self): # type: () -> str if self._raw_conn is NULL: return - return (taos_get_server_info(self._raw_conn)).decode("utf-8") + return taos_get_server_info(self._raw_conn).decode("utf-8") def select_db(self, database: str): _database = database.encode("utf-8") - res = taos_select_db(self._raw_conn, _database) + res = taos_select_db(self._raw_conn, _database) if res != 0: raise DatabaseError("select database error", res) @@ -132,23 +134,34 @@ cdef class TaosConnection: def query(self, sql: str, req_id: Optional[int] = None): _sql = sql.encode("utf-8") if req_id is None: - res = taos_query(self._raw_conn, _sql) + res = taos_query(self._raw_conn, _sql) else: - res = taos_query_with_reqid(self._raw_conn, _sql, req_id) + res = taos_query_with_reqid(self._raw_conn, _sql, req_id) return TaosResult(res) def query_a(self, sql: str, callback, req_id: Optional[int] = None): _sql = sql.encode("utf-8") if req_id is None: - taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) + taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) else: - taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + + def subscribe(self, configs: dict[str, str], callback): + if self._raw_conn is NULL: + return None + + tmq_conf = tmq_conf_new() + for k, v in configs.items(): + _k = k.encode("utf-8") + _v = v.encode("utf-8") + tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) + print("tmq_conf_res:", tmq_conf_res) def load_table_info(self, tables: list): # type: (str) -> None _tables = ",".join(tables).encode("utf-8") - taos_load_table_info(self._raw_conn, _tables) + taos_load_table_info(self._raw_conn, _tables) def commit(self): """Commit any pending transaction to the database. @@ -173,7 +186,7 @@ cdef class TaosConnection: cdef int vg_id _db = db.encode("utf-8") _table = table.encode("utf-8") - code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) + code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) if code != 0: raise InternalError(taos_errstr(NULL)) return vg_id @@ -243,7 +256,7 @@ cdef class TaosResult: @property def fields(self): - return [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] + return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] @property def field_count(self): @@ -396,6 +409,229 @@ cdef class TaosResult: self._res = NULL self._fields = NULL + +cdef class TaosCursor: + cdef list _description + cdef TaosConnection _connection + cdef TaosResult _result + + def __init__(self, connection: TaosConnection=None) -> None: + self._description = [] + self._connection = connection + self._result = None + + def __iter__(self): + for block, num_of_rows in self._result.blocks_iter(): + for row in block: + yield row + + @property + def description(self): + return self._description + + @property + def rowcount(self): + return self._result.row_count + + @property + def affected_rows(self): + """Return the rowcount of insertion""" + return self._result.affected_rows + + def execute(self, sql, params=None, req_id: Optional[int] = None): + """Prepare and execute a database operation (query or command).""" + if not self._connection: + raise ProgrammingError("Cursor is not connected") + + self._reset_result() + + self._result = self._connection.query(sql, req_id) + self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] + + def fetchone(self): + return next(self) + + def fetchall(self): + return [r for r in self] + + def close(self): + if self._connection is None: + return False + + self._reset_result() + self._connection = None + + return True + + def _reset_result(self): + """Reset the result to unused version.""" + self._description = [] + self._result = None + + def __del__(self): + self.close() + + +cdef class TaosTopicAssignment: + cdef int32_t _vg_id + cdef int64_t _current_offset + cdef int64_t _begin + cdef int64_t _end + + def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): + self._vg_id = vg_id + self._current_offset = current_offset + self._begin = begin + self._end = end + + @property + def vg_id(self): + return self._vg_id + + @property + def current_offset(self): + return self._current_offset + + @property + def begin(self): + return self._begin + + @property + def end(self): + return self._end + + +cdef class TaosConsumer: + cdef dict _configs + cdef tmq_conf_t *_tmq_conf + cdef tmq_t *_tmq + + def __cinit__(self, configs: dict[str, str]): + self._configs = configs + self._tmq_conf = tmq_conf_new() + for k, v in self._configs.items(): + _k = k.encode("utf-8") + _v = v.encode("utf-8") + tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) + if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: + tmq_conf_destroy(self._tmq_conf) + self._tmq_conf = NULL + raise Exception("set up tmq config failed!") + + self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) + if self._tmq is NULL: + raise Exception("setup tmq failed") + + def subscribe(self, topics: list[str]): + tmq_list = tmq_list_new() + if tmq_list is NULL: + raise Exception("set up tmq list failed!") + + for tp in topics: + _tp = tp.encode("utf-8") + tmq_errno = tmq_list_append(tmq_list, _tp) + if tmq_errno != 0: + tmq_list_destroy(tmq_list) + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + tmq_errno = tmq_subscribe(self._tmq, tmq_list) + if tmq_errno != 0: + tmq_list_destroy(tmq_list) + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + def unsubscribe(self): + tmq_errno = tmq_unsubscribe(self._tmq) + if tmq_errno != 0: + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + def poll(self, timeout: int): + res = tmq_consumer_poll(self._tmq, timeout) + if res is NULL: + return None + + return TaosResult(res) + + def commit(self, taos_res: TaosResult): + self.result_commit(taos_res) + + def result_commit(self, taos_res: TaosResult): + tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) + if tmq_errno != 0: + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + def offset_commit(self, topic: str, vg_id: int, offset: int): + _topic = topic.encode("utf-8") + tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + if tmq_errno != 0: + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + def get_topic_assignment(self, topic: str): + cdef int32_t num_of_assignment + cdef tmq_topic_assignment *assignment_ptr = NULL + _topic = topic.encode("utf-8") + tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) + if tmq_errno != 0: + tmq_free_assignment(assignment_ptr) + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + cdef tmq_topic_assignment *assignment + topic_assignments = [] + for i in range(num_of_assignment): + assignment = &assignment_ptr[i] + tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) + topic_assignments.append(tta) + + tmq_free_assignment(assignment_ptr) + + return topic_assignments + + def offset_seek(self, topic: str, vg_id: int, offset: int): + _topic = topic.encode("utf-8") + tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + if tmq_errno != 0: + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + def position(self, topic: str, vg_id: int): + _topic = topic.encode("utf-8") + pos = tmq_position(self._tmq, _topic, vg_id) + if pos < 0: + raise TmqError(tmq_err2str(pos), pos) + + return pos + + def committed(self, topic: str, vg_id: int): + _topic = topic.encode("utf-8") + offset = tmq_committed(self._tmq, _topic, vg_id) + if offset == -2147467247: + return None + + if offset < 0: + raise TmqError(tmq_err2str(offset), offset) + + return offset + + def get_topic_name(self, taos_res: TaosResult): + return tmq_get_topic_name(taos_res._res) + + def get_db_name(self, taos_res: TaosResult): + return tmq_get_db_name(taos_res._res) + + def get_vgroup_id(self, taos_res: TaosResult): + return tmq_get_vgroup_id(taos_res._res) + + def get_vgroup_offset(self, taos_res: TaosResult): + return tmq_get_vgroup_offset(taos_res._res) + + def __dealloc__(self): + if self._tmq_conf is not NULL: + tmq_conf_destroy(self._tmq_conf) + self._tmq_conf = NULL + + if self._tmq is not NULL: + tmq_consumer_close(self._tmq) + self._tmq = NULL + + # class TaosStmt(object): # cdef TAOS_STMT *_stmt # diff --git a/taos/_parser.cpp b/taos/_parser.cpp new file mode 100644 index 00000000..58fb6251 --- /dev/null +++ b/taos/_parser.cpp @@ -0,0 +1,7259 @@ +/* Generated by Cython 3.0.0 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "language": "c++", + "name": "taos._parser", + "sources": [ + "taos/_parser.pyx" + ] + }, + "module_name": "taos._parser" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#define CYTHON_ABI "3_0_0" +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030000F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PY_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(const U& other) const { return *ptr == other; } + template bool operator !=(const U& other) const { return *ptr != other; } + template bool operator==(const __Pyx_FakeReference& other) const { return *ptr == *other.ptr; } + template bool operator!=(const __Pyx_FakeReference& other) const { return *ptr != *other.ptr; } + private: + T *ptr; +}; + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if PY_VERSION_HEX >= 0x030B00A1 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; + PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; + const char *fn_cstr=NULL; + const char *name_cstr=NULL; + PyCodeObject *co=NULL, *result=NULL; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + if (!(kwds=PyDict_New())) goto end; + if (!(argcount=PyLong_FromLong(a))) goto end; + if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; + if (!(posonlyargcount=PyLong_FromLong(p))) goto end; + if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; + if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; + if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; + if (!(nlocals=PyLong_FromLong(l))) goto end; + if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; + if (!(stacksize=PyLong_FromLong(s))) goto end; + if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; + if (!(flags=PyLong_FromLong(f))) goto end; + if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; + if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; + if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; + if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; + if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; + if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; + if (!(empty = PyTuple_New(0))) goto end; + result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); + end: + Py_XDECREF((PyObject*) co); + Py_XDECREF(kwds); + Py_XDECREF(argcount); + Py_XDECREF(posonlyargcount); + Py_XDECREF(kwonlyargcount); + Py_XDECREF(nlocals); + Py_XDECREF(stacksize); + Py_XDECREF(replace); + Py_XDECREF(empty); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE(obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #define __PYX_EXTERN_C extern "C++" +#endif + +#define __PYX_HAVE__taos___parser +#define __PYX_HAVE_API__taos___parser +/* Early includes */ +#include +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else // Py < 3.12 + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "taos\\\\_parser.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* IncludeStringH.proto */ +#include + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "libc.stdint" */ + +/* Module declarations from "libcpp" */ + +/* Module declarations from "taos._parser" */ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "taos._parser" +extern int __pyx_module_is_main_taos___parser; +int __pyx_module_is_main_taos___parser = 0; + +/* Implementation of "taos._parser" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_range; +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "*"; +static const char __pyx_k__2[] = "?"; +static const char __pyx_k_dt[] = "dt"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_spec[] = "__spec__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_seconds[] = "seconds"; +static const char __pyx_k_datetime[] = "datetime"; +static const char __pyx_k_timedelta[] = "timedelta"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +/* #### Code section: decls ### */ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyObject *__pyx_n_s_; + PyObject *__pyx_n_s__2; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_datetime; + PyObject *__pyx_n_s_dt; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_seconds; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_timedelta; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_n_s_); + Py_CLEAR(clear_module_state->__pyx_n_s__2); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_datetime); + Py_CLEAR(clear_module_state->__pyx_n_s_dt); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_seconds); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_timedelta); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_n_s_); + Py_VISIT(traverse_module_state->__pyx_n_s__2); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_datetime); + Py_VISIT(traverse_module_state->__pyx_n_s_dt); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_seconds); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_timedelta); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ +#define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime +#define __pyx_n_s_dt __pyx_mstate_global->__pyx_n_s_dt +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_seconds __pyx_mstate_global->__pyx_n_s_seconds +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_timedelta __pyx_mstate_global->__pyx_n_s_timedelta +/* #### Code section: module_code ### */ + +/* "taos/_parser.pyx":3 + * import datetime as dt + * + * cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_binary_string(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, int __pyx_v_field_length) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + size_t __pyx_v_nchar_ptr; + PyObject *__pyx_v_py_string = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_binary_string", 0); + + /* "taos/_parser.pyx":4 + * + * cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * for i in range(abs(num_of_rows)): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":6 + * cdef list res = [] + * cdef int i + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * nchar_ptr = ptr + field_length * i + * py_string = (nchar_ptr).decode("utf-8") + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":7 + * cdef int i + * for i in range(abs(num_of_rows)): + * nchar_ptr = ptr + field_length * i # <<<<<<<<<<<<<< + * py_string = (nchar_ptr).decode("utf-8") + * res.append(py_string) + */ + __pyx_v_nchar_ptr = (__pyx_v_ptr + (__pyx_v_field_length * __pyx_v_i)); + + /* "taos/_parser.pyx":8 + * for i in range(abs(num_of_rows)): + * nchar_ptr = ptr + field_length * i + * py_string = (nchar_ptr).decode("utf-8") # <<<<<<<<<<<<<< + * res.append(py_string) + * + */ + __pyx_t_5 = ((char *)__pyx_v_nchar_ptr); + __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_5, 0, strlen(__pyx_t_5), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_py_string, __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "taos/_parser.pyx":9 + * nchar_ptr = ptr + field_length * i + * py_string = (nchar_ptr).decode("utf-8") + * res.append(py_string) # <<<<<<<<<<<<<< + * + * return res + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_py_string); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 9, __pyx_L1_error) + } + + /* "taos/_parser.pyx":11 + * res.append(py_string) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":3 + * import datetime as dt + * + * cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_binary_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF(__pyx_v_py_string); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":13 + * return res + * + * cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_nchar_string(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, int __pyx_v_field_length) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + size_t __pyx_v_c_char_ptr; + PyObject *__pyx_v_py_string = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_nchar_string", 0); + + /* "taos/_parser.pyx":14 + * + * cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * for i in range(abs(num_of_rows)): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":16 + * cdef list res = [] + * cdef int i + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * c_char_ptr = ptr + field_length * i + * py_string = (c_char_ptr)[:field_length].decode("utf-8") + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":17 + * cdef int i + * for i in range(abs(num_of_rows)): + * c_char_ptr = ptr + field_length * i # <<<<<<<<<<<<<< + * py_string = (c_char_ptr)[:field_length].decode("utf-8") + * res.append(py_string) + */ + __pyx_v_c_char_ptr = (__pyx_v_ptr + (__pyx_v_field_length * __pyx_v_i)); + + /* "taos/_parser.pyx":18 + * for i in range(abs(num_of_rows)): + * c_char_ptr = ptr + field_length * i + * py_string = (c_char_ptr)[:field_length].decode("utf-8") # <<<<<<<<<<<<<< + * res.append(py_string) + * + */ + __pyx_t_1 = __Pyx_decode_c_string(((char *)__pyx_v_c_char_ptr), 0, __pyx_v_field_length, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_py_string, __pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":19 + * c_char_ptr = ptr + field_length * i + * py_string = (c_char_ptr)[:field_length].decode("utf-8") + * res.append(py_string) # <<<<<<<<<<<<<< + * + * return res + */ + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_py_string); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 19, __pyx_L1_error) + } + + /* "taos/_parser.pyx":21 + * res.append(py_string) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":13 + * return res + * + * cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_nchar_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF(__pyx_v_py_string); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":23 + * return res + * + * cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_string(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, int *__pyx_v_offsets) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + size_t __pyx_v_rbyte_ptr; + size_t __pyx_v_c_char_ptr; + uint16_t __pyx_v_rbyte; + PyObject *__pyx_v_py_string = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_string", 0); + + /* "taos/_parser.pyx":24 + * + * cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * cdef size_t rbyte_ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":28 + * cdef size_t rbyte_ptr + * cdef size_t c_char_ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if offsets[i] == -1: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":29 + * cdef size_t c_char_ptr + * for i in range(abs(num_of_rows)): + * if offsets[i] == -1: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + __pyx_t_5 = ((__pyx_v_offsets[__pyx_v_i]) == -1L); + if (__pyx_t_5) { + + /* "taos/_parser.pyx":30 + * for i in range(abs(num_of_rows)): + * if offsets[i] == -1: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * rbyte_ptr = ptr + offsets[i] + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 30, __pyx_L1_error) + + /* "taos/_parser.pyx":29 + * cdef size_t c_char_ptr + * for i in range(abs(num_of_rows)): + * if offsets[i] == -1: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":32 + * res.append(None) + * else: + * rbyte_ptr = ptr + offsets[i] # <<<<<<<<<<<<<< + * rbyte = (rbyte_ptr)[0] + * c_char_ptr = rbyte_ptr + sizeof(uint16_t) + */ + /*else*/ { + __pyx_v_rbyte_ptr = (__pyx_v_ptr + (__pyx_v_offsets[__pyx_v_i])); + + /* "taos/_parser.pyx":33 + * else: + * rbyte_ptr = ptr + offsets[i] + * rbyte = (rbyte_ptr)[0] # <<<<<<<<<<<<<< + * c_char_ptr = rbyte_ptr + sizeof(uint16_t) + * py_string = (c_char_ptr)[:rbyte].decode("utf-8") + */ + __pyx_v_rbyte = (((uint16_t *)__pyx_v_rbyte_ptr)[0]); + + /* "taos/_parser.pyx":34 + * rbyte_ptr = ptr + offsets[i] + * rbyte = (rbyte_ptr)[0] + * c_char_ptr = rbyte_ptr + sizeof(uint16_t) # <<<<<<<<<<<<<< + * py_string = (c_char_ptr)[:rbyte].decode("utf-8") + * res.append(py_string) + */ + __pyx_v_c_char_ptr = (__pyx_v_rbyte_ptr + (sizeof(uint16_t))); + + /* "taos/_parser.pyx":35 + * rbyte = (rbyte_ptr)[0] + * c_char_ptr = rbyte_ptr + sizeof(uint16_t) + * py_string = (c_char_ptr)[:rbyte].decode("utf-8") # <<<<<<<<<<<<<< + * res.append(py_string) + * + */ + __pyx_t_1 = __Pyx_decode_c_string(((char *)__pyx_v_c_char_ptr), 0, __pyx_v_rbyte, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_py_string, __pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":36 + * c_char_ptr = rbyte_ptr + sizeof(uint16_t) + * py_string = (c_char_ptr)[:rbyte].decode("utf-8") + * res.append(py_string) # <<<<<<<<<<<<<< + * + * return res + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_py_string); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 36, __pyx_L1_error) + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":38 + * res.append(py_string) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":23 + * return res + * + * cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF(__pyx_v_py_string); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":40 + * return res + * + * cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_bool(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + bool *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_bool", 0); + + /* "taos/_parser.pyx":41 + * + * cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":43 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((bool *)__pyx_v_ptr); + + /* "taos/_parser.pyx":44 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":45 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 45, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":46 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 46, __pyx_L1_error) + + /* "taos/_parser.pyx":45 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":48 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":50 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":40 + * return res + * + * cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":52 + * return res + * + * cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_int8_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + int8_t *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_int8_t", 0); + + /* "taos/_parser.pyx":53 + * + * cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":55 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((int8_t *)__pyx_v_ptr); + + /* "taos/_parser.pyx":56 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":57 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 57, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":58 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 58, __pyx_L1_error) + + /* "taos/_parser.pyx":57 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":60 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_int8_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":62 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":52 + * return res + * + * cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":64 + * return res + * + * cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_int16_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + int16_t *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_int16_t", 0); + + /* "taos/_parser.pyx":65 + * + * cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":67 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((int16_t *)__pyx_v_ptr); + + /* "taos/_parser.pyx":68 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":69 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 69, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":70 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 70, __pyx_L1_error) + + /* "taos/_parser.pyx":69 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":72 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_int16_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":74 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":64 + * return res + * + * cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":76 + * return res + * + * cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_int32_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + int32_t *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_int32_t", 0); + + /* "taos/_parser.pyx":77 + * + * cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":79 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((int32_t *)__pyx_v_ptr); + + /* "taos/_parser.pyx":80 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":81 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 81, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":82 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 82, __pyx_L1_error) + + /* "taos/_parser.pyx":81 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":84 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_int32_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":86 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":76 + * return res + * + * cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":88 + * return res + * + * cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_int64_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + int64_t *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_int64_t", 0); + + /* "taos/_parser.pyx":89 + * + * cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":91 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((int64_t *)__pyx_v_ptr); + + /* "taos/_parser.pyx":92 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":93 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 93, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":94 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 94, __pyx_L1_error) + + /* "taos/_parser.pyx":93 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":96 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_int64_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":98 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":88 + * return res + * + * cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":100 + * return res + * + * cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_uint8_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + uint8_t *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_uint8_t", 0); + + /* "taos/_parser.pyx":101 + * + * cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":103 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((uint8_t *)__pyx_v_ptr); + + /* "taos/_parser.pyx":104 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":105 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 105, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":106 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 106, __pyx_L1_error) + + /* "taos/_parser.pyx":105 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":108 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_uint8_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":110 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":100 + * return res + * + * cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":112 + * return res + * + * cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_uint16_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + uint16_t *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_uint16_t", 0); + + /* "taos/_parser.pyx":113 + * + * cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":115 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((uint16_t *)__pyx_v_ptr); + + /* "taos/_parser.pyx":116 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":117 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 117, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":118 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 118, __pyx_L1_error) + + /* "taos/_parser.pyx":117 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":120 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_uint16_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":122 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":112 + * return res + * + * cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":124 + * return res + * + * cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_uint32_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + uint32_t *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_uint32_t", 0); + + /* "taos/_parser.pyx":125 + * + * cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":127 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((uint32_t *)__pyx_v_ptr); + + /* "taos/_parser.pyx":128 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":129 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 129, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":130 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 130, __pyx_L1_error) + + /* "taos/_parser.pyx":129 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":132 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_uint32_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":134 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":124 + * return res + * + * cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":136 + * return res + * + * cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_uint64_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + uint64_t *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_uint64_t", 0); + + /* "taos/_parser.pyx":137 + * + * cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":139 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((uint64_t *)__pyx_v_ptr); + + /* "taos/_parser.pyx":140 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":141 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 141, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":142 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 142, __pyx_L1_error) + + /* "taos/_parser.pyx":141 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":144 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_uint64_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":146 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":136 + * return res + * + * cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":148 + * return res + * + * cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_int(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + int *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_int", 0); + + /* "taos/_parser.pyx":149 + * + * cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":151 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((int *)__pyx_v_ptr); + + /* "taos/_parser.pyx":152 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":153 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 153, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":154 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 154, __pyx_L1_error) + + /* "taos/_parser.pyx":153 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":156 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":158 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":148 + * return res + * + * cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":160 + * return res + * + * cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_uint(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + unsigned int *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_uint", 0); + + /* "taos/_parser.pyx":161 + * + * cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":163 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((unsigned int *)__pyx_v_ptr); + + /* "taos/_parser.pyx":164 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":165 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 165, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":166 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 166, __pyx_L1_error) + + /* "taos/_parser.pyx":165 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":168 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":170 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":160 + * return res + * + * cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_uint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":172 + * return res + * + * cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_float(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + float *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_float", 0); + + /* "taos/_parser.pyx":173 + * + * cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":175 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((float *)__pyx_v_ptr); + + /* "taos/_parser.pyx":176 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":177 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 177, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":178 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 178, __pyx_L1_error) + + /* "taos/_parser.pyx":177 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":180 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":182 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":172 + * return res + * + * cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_float", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":184 + * return res + * + * cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_double(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + double *__pyx_v_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_double", 0); + + /* "taos/_parser.pyx":185 + * + * cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * v_ptr = ptr + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":187 + * cdef list res = [] + * cdef int i + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((double *)__pyx_v_ptr); + + /* "taos/_parser.pyx":188 + * cdef int i + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":189 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 189, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":190 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * res.append(v_ptr[i]) + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 190, __pyx_L1_error) + + /* "taos/_parser.pyx":189 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":192 + * res.append(None) + * else: + * res.append(v_ptr[i]) # <<<<<<<<<<<<<< + * + * return res + */ + /*else*/ { + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":194 + * res.append(v_ptr[i]) + * + * return res # <<<<<<<<<<<<<< + * + * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":184 + * return res + * + * cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("taos._parser._parse_double", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "taos/_parser.pyx":196 + * return res + * + * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + +static PyObject *__pyx_f_4taos_7_parser__parse_timestamp(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null, int __pyx_v_precision, PyObject *__pyx_v_dt_epoch) { + PyObject *__pyx_v_res = 0; + int __pyx_v_i; + double __pyx_v_denom; + int64_t *__pyx_v_v_ptr; + PyObject *__pyx_v_raw_value = NULL; + PyObject *__pyx_v__dt = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_parse_timestamp", 0); + + /* "taos/_parser.pyx":197 + * + * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): + * cdef list res = [] # <<<<<<<<<<<<<< + * cdef int i + * cdef double denom = 10**((precision + 1) * 3) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_res = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":199 + * cdef list res = [] + * cdef int i + * cdef double denom = 10**((precision + 1) * 3) # <<<<<<<<<<<<<< + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + */ + __pyx_v_denom = pow(10.0, ((double)((__pyx_v_precision + 1) * 3))); + + /* "taos/_parser.pyx":200 + * cdef int i + * cdef double denom = 10**((precision + 1) * 3) + * v_ptr = ptr # <<<<<<<<<<<<<< + * for i in range(abs(num_of_rows)): + * if is_null[i]: + */ + __pyx_v_v_ptr = ((int64_t *)__pyx_v_ptr); + + /* "taos/_parser.pyx":201 + * cdef double denom = 10**((precision + 1) * 3) + * v_ptr = ptr + * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< + * if is_null[i]: + * res.append(None) + */ + __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "taos/_parser.pyx":202 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + if (unlikely(__pyx_v_is_null == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 202, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "taos/_parser.pyx":203 + * for i in range(abs(num_of_rows)): + * if is_null[i]: + * res.append(None) # <<<<<<<<<<<<<< + * else: + * raw_value = v_ptr[i] + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 203, __pyx_L1_error) + + /* "taos/_parser.pyx":202 + * v_ptr = ptr + * for i in range(abs(num_of_rows)): + * if is_null[i]: # <<<<<<<<<<<<<< + * res.append(None) + * else: + */ + goto __pyx_L5; + } + + /* "taos/_parser.pyx":205 + * res.append(None) + * else: + * raw_value = v_ptr[i] # <<<<<<<<<<<<<< + * if precision <= 1: + * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyInt_From_int64_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_raw_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":206 + * else: + * raw_value = v_ptr[i] + * if precision <= 1: # <<<<<<<<<<<<<< + * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) + * else: + */ + __pyx_t_5 = (__pyx_v_precision <= 1); + if (__pyx_t_5) { + + /* "taos/_parser.pyx":207 + * raw_value = v_ptr[i] + * if precision <= 1: + * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) # <<<<<<<<<<<<<< + * else: + * _dt = raw_value + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_denom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_v_raw_value, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seconds, __pyx_t_9) < 0) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_v_dt_epoch, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v__dt, __pyx_t_1); + __pyx_t_1 = 0; + + /* "taos/_parser.pyx":206 + * else: + * raw_value = v_ptr[i] + * if precision <= 1: # <<<<<<<<<<<<<< + * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) + * else: + */ + goto __pyx_L6; + } + + /* "taos/_parser.pyx":209 + * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) + * else: + * _dt = raw_value # <<<<<<<<<<<<<< + * res.append(_dt) + * return res + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_raw_value); + __Pyx_XDECREF_SET(__pyx_v__dt, __pyx_v_raw_value); + } + __pyx_L6:; + + /* "taos/_parser.pyx":210 + * else: + * _dt = raw_value + * res.append(_dt) # <<<<<<<<<<<<<< + * return res + */ + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v__dt); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 210, __pyx_L1_error) + } + __pyx_L5:; + } + + /* "taos/_parser.pyx":211 + * _dt = raw_value + * res.append(_dt) + * return res # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_res); + __pyx_r = __pyx_v_res; + goto __pyx_L0; + + /* "taos/_parser.pyx":196 + * return res + * + * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("taos._parser._parse_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_res); + __Pyx_XDECREF(__pyx_v_raw_value); + __Pyx_XDECREF(__pyx_v__dt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, + {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 6, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_RefNannyFinishContext(); + return 0; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_parse_binary_string", (void (*)(void))__pyx_f_4taos_7_parser__parse_binary_string, "PyObject *(size_t, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_nchar_string", (void (*)(void))__pyx_f_4taos_7_parser__parse_nchar_string, "PyObject *(size_t, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_string", (void (*)(void))__pyx_f_4taos_7_parser__parse_string, "PyObject *(size_t, int, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_bool", (void (*)(void))__pyx_f_4taos_7_parser__parse_bool, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_int8_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_int8_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_int16_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_int16_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_int32_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_int32_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_int64_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_int64_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_uint8_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint8_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_uint16_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint16_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_uint32_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint32_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_uint64_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint64_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_int", (void (*)(void))__pyx_f_4taos_7_parser__parse_int, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_uint", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_float", (void (*)(void))__pyx_f_4taos_7_parser__parse_float, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_double", (void (*)(void))__pyx_f_4taos_7_parser__parse_double, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_parse_timestamp", (void (*)(void))__pyx_f_4taos_7_parser__parse_timestamp, "PyObject *(size_t, int, PyObject *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__parser(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__parser}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_parser", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_parser(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_parser(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__parser(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__parser(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__parser(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_parser' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_parser", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to _parser pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_b); + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__parser(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_taos___parser) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "taos._parser")) { + if (unlikely((PyDict_SetItemString(modules, "taos._parser", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_init_code(); + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "taos/_parser.pyx":1 + * import datetime as dt # <<<<<<<<<<<<<< + * + * cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "taos/_parser.pyx":196 + * return res + * + * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): # <<<<<<<<<<<<<< + * cdef list res = [] + * cdef int i + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init taos._parser", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init taos._parser"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* decode_c_string */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, 1); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + #endif + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + #if CYTHON_COMPILING_IN_LIMITED_API + module = PyImport_ImportModuleLevelObject( + name, empty_dict, empty_dict, from_list, level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportDottedModule */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s_; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + _PyTraceback_Add(funcname, filename, py_line); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int8_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int8_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int8_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int8_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int16_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int16_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int16_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int16_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int32_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int32_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int32_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int32_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int64_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int64_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int64_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int64_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(uint8_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(uint8_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(uint8_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(uint16_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(uint16_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(uint16_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(uint32_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(uint32_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(uint32_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(uint64_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(uint64_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(uint64_t), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(unsigned int), + little, !is_unsigned); + } +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__2)); + } + return name; +} +#endif + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i '9'); + break; + } + if (rt_from_call[i] != ctversion[i]) { + same = 0; + break; + } + } + if (!same) { + char rtversion[5] = {'\0'}; + char message[200]; + for (i=0; i<4; ++i) { + if (rt_from_call[i] == '.') { + if (found_dot) break; + found_dot = 1; + } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { + break; + } + rtversion[i] = rt_from_call[i]; + } + PyOS_snprintf(message, sizeof(message), + "compile time version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; + cobj = PyCapsule_New(tmp.p, sig, 0); + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/taos/_parser.pxd b/taos/_parser.pxd index bdc81111..d1cc1975 100644 --- a/taos/_parser.pxd +++ b/taos/_parser.pxd @@ -33,4 +33,4 @@ cdef list _parse_float(size_t ptr, int num_of_rows, list is_null) cdef list _parse_double(size_t ptr, int num_of_rows, list is_null) -cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch) \ No newline at end of file +cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch) \ No newline at end of file diff --git a/taos/_parser.pyx b/taos/_parser.pyx index af5cbce1..5792512f 100644 --- a/taos/_parser.pyx +++ b/taos/_parser.pyx @@ -30,8 +30,8 @@ cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): res.append(None) else: rbyte_ptr = ptr + offsets[i] - rbyte = (rbyte_ptr)[0] - c_char_ptr = rbyte_ptr + sizeof(unsigned short) + rbyte = (rbyte_ptr)[0] + c_char_ptr = rbyte_ptr + sizeof(uint16_t) py_string = (c_char_ptr)[:rbyte].decode("utf-8") res.append(py_string) diff --git a/temp b/temp new file mode 100644 index 00000000..922490a9 --- /dev/null +++ b/temp @@ -0,0 +1,30 @@ +cdef extern from "taos.h": + ctypedef bool + ctypedef int32_t + ctypedef void TAOS_RES + bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col) + +from taos._cinterface cimport taos_is_null, TAOS_RES, bool, int32_t + + +cpdef taos_get_column_data_is_null(size_t result, int32_t field, int32_t rows): + is_null = [] + cdef TAOS_RES* res = result + cdef int32_t i + for i in range(rows): + is_null.append(taos_is_null(res, i, field)) + + return is_null + + c_string = (ptr + offsets[i] + sizeof(unsigned short)) + py_bytes_string = c_string[:rbyte] + res.append(py_bytes_string.decode("utf-8")) + + +"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:taos/taos_raw/libs /LIBPATH:C:\Users\lighthorse\anaconda3\envs\taos_env\libs /LIBPATH:C:\Users\lighthorse\anaconda3\envs\taos_env /LIBPATH:C:\Users\lighthorse\anaconda3\envs\taos_env\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" taos.lib /EXPORT:PyInit__cinterface E:\soure_code\taos-connector-python\build\temp.win-amd64-cpython-310\Release\taos/_cinterface.obj /OUT:E:\soure_code\taos-connector-python\build\lib.win-amd64-cpython-310\taos\_cinterface.cp310-win_amd64.pyd /IMPLIB:E:\soure_code\taos-connector-python\build\temp.win-amd64-cpython-310\Release\taos\_cinterface.cp310-win_amd64.lib + +from taos._objects import TaosConnection +conn = TaosConnection(host="localhost", user="root", password="taosdata", database="lhdata", port=6030, timezone="Asia/Shanghai", config="C:\TDengine\cfg") +%%prun -s cumulative +tr = conn.query("SELECT * FROM daily_bar WHERE symbol = '000001 CH Equity'") +data = tr.fetch_all() \ No newline at end of file From 49cb853d6f80efb1c59e1717daf576baa5237b2d Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Fri, 25 Aug 2023 17:45:24 +0800 Subject: [PATCH 07/31] remove c/c++ file --- taos/_cinterface.c | 10569 -------------- taos/_objects.c | 33552 ------------------------------------------- taos/_parser.cpp | 7259 ---------- 3 files changed, 51380 deletions(-) delete mode 100644 taos/_cinterface.c delete mode 100644 taos/_objects.c delete mode 100644 taos/_parser.cpp diff --git a/taos/_cinterface.c b/taos/_cinterface.c deleted file mode 100644 index 8986c207..00000000 --- a/taos/_cinterface.c +++ /dev/null @@ -1,10569 +0,0 @@ -/* Generated by Cython 3.0.0 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [ - "C:\\TDengine\\include\\taos.h" - ], - "include_dirs": [ - "C:\\TDengine\\include" - ], - "libraries": [ - "taos" - ], - "library_dirs": [ - "C:\\TDengine\\driver" - ], - "name": "taos._cinterface", - "sources": [ - "taos/_cinterface.pyx" - ] - }, - "module_name": "taos._cinterface" -} -END: Cython Metadata */ - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif -#endif - -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#define CYTHON_ABI "3_0_0" -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030000F0 -#define CYTHON_FUTURE_DIVISION 1 -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#if defined(GRAALVM_PYTHON) - /* For very preliminary testing purposes. Most variables are set the same as PyPy. - The existence of this section does not imply that anything works or is even tested */ - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PYPY_VERSION) - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #if PY_VERSION_HEX < 0x03090000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(CYTHON_LIMITED_API) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 1 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 1 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #endif - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PY_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #ifndef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 1 - #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 1 - #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 1 - #endif - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #elif !defined(CYTHON_USE_UNICODE_WRITER) - #define CYTHON_USE_UNICODE_WRITER 1 - #endif - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #ifndef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 1 - #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) - #endif - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) - #endif - #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 1 - #endif - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #if PY_VERSION_HEX < 0x030600B1 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) - #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) - #define CYTHON_USE_EXC_INFO_STACK 1 - #endif - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif -#endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) -#endif -#if !defined(CYTHON_VECTORCALL) -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) -#endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif - #undef SHIFT - #undef BASE - #undef MASK - #ifdef SIZEOF_VOID_P - enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; - #endif -#endif -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif -#ifndef __has_cpp_attribute - #define __has_cpp_attribute(x) 0 -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifndef CYTHON_UNUSED - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(maybe_unused) - #define CYTHON_UNUSED [[maybe_unused]] - #endif - #endif - #endif -#endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_UNUSED_VAR -# if defined(__cplusplus) - template void CYTHON_UNUSED_VAR( const T& ) { } -# else -# define CYTHON_UNUSED_VAR(x) (void)(x) -# endif -#endif -#ifndef CYTHON_MAYBE_UNUSED_VAR - #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif -#ifndef CYTHON_FALLTHROUGH - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(fallthrough) - #define CYTHON_FALLTHROUGH [[fallthrough]] - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_cpp_attribute(clang::fallthrough) - #define CYTHON_FALLTHROUGH [[clang::fallthrough]] - #elif __has_cpp_attribute(gnu::fallthrough) - #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] - #endif - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_attribute(fallthrough) - #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) - #else - #define CYTHON_FALLTHROUGH - #endif - #endif - #if defined(__clang__) && defined(__apple_build_version__) - #if __apple_build_version__ < 7000000 - #undef CYTHON_FALLTHROUGH - #define CYTHON_FALLTHROUGH - #endif - #endif -#endif -#ifdef __cplusplus - template - struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; - #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) -#else - #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) -#endif -#if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) -#else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) -#endif -#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) - -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #elif defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type -#if PY_VERSION_HEX >= 0x030B00A1 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; - PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; - const char *fn_cstr=NULL; - const char *name_cstr=NULL; - PyCodeObject *co=NULL, *result=NULL; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - if (!(kwds=PyDict_New())) goto end; - if (!(argcount=PyLong_FromLong(a))) goto end; - if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; - if (!(posonlyargcount=PyLong_FromLong(p))) goto end; - if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; - if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; - if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; - if (!(nlocals=PyLong_FromLong(l))) goto end; - if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; - if (!(stacksize=PyLong_FromLong(s))) goto end; - if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; - if (!(flags=PyLong_FromLong(f))) goto end; - if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; - if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; - if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; - if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; - if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; - if (!(empty = PyTuple_New(0))) goto end; - result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); - end: - Py_XDECREF((PyObject*) co); - Py_XDECREF(kwds); - Py_XDECREF(argcount); - Py_XDECREF(posonlyargcount); - Py_XDECREF(kwonlyargcount); - Py_XDECREF(nlocals); - Py_XDECREF(stacksize); - Py_XDECREF(replace); - Py_XDECREF(empty); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#endif -#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) - #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) -#else - #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) - #define __Pyx_Py_Is(x, y) Py_Is(x, y) -#else - #define __Pyx_Py_Is(x, y) ((x) == (y)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) - #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) -#else - #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) - #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) -#else - #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) - #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) -#else - #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) -#endif -#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) -#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) -#else - #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) -#endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#ifndef Py_TPFLAGS_SEQUENCE - #define Py_TPFLAGS_SEQUENCE 0 -#endif -#ifndef Py_TPFLAGS_MAPPING - #define Py_TPFLAGS_MAPPING 0 -#endif -#ifndef METH_STACKLESS - #define METH_STACKLESS 0 -#endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) - #ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - #endif - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); - typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, - Py_ssize_t nargs, PyObject *kwnames); -#else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords -#endif -#if CYTHON_METH_FASTCALL - #define __Pyx_METH_FASTCALL METH_FASTCALL - #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast - #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords -#else - #define __Pyx_METH_FASTCALL METH_VARARGS - #define __Pyx_PyCFunction_FastCall PyCFunction - #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords -#endif -#if CYTHON_VECTORCALL - #define __pyx_vectorcallfunc vectorcallfunc - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET - #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) -#else - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) -#endif -#if PY_VERSION_HEX < 0x030900B1 - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) - typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); -#else - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) - #define __Pyx_PyCMethod PyCMethod -#endif -#ifndef METH_METHOD - #define METH_METHOD 0x200 -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyThreadState_Current PyThreadState_Get() -#elif !CYTHON_FAST_THREAD_STATE - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#else - #define __Pyx_PyThreadState_Current _PyThreadState_Current -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) -{ - void *result; - result = PyModule_GetState(op); - if (!result) - Py_FatalError("Couldn't find the module state"); - return result; -} -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) -#else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif -#endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) -#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) -#else -#define __Pyx_PyDict_NewPresized(n) PyDict_New() -#endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS -#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { - PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); - if (res == NULL) PyErr_Clear(); - return res; -} -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) -#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#else -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { -#if CYTHON_COMPILING_IN_PYPY - return PyDict_GetItem(dict, name); -#else - PyDictEntry *ep; - PyDictObject *mp = (PyDictObject*) dict; - long hash = ((PyStringObject *) name)->ob_shash; - assert(hash != -1); - ep = (mp->ma_lookup)(mp, name, hash); - if (ep == NULL) { - return NULL; - } - return ep->me_value; -#endif -} -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#endif -#if CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) - #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) -#else - #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) - #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 -#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ - assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ - PyObject_GC_Del(obj);\ - Py_DECREF(type);\ -} -#else -#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) - #define __Pyx_PyUnicode_DATA(u) ((void*)u) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_READY(op) (0) - #else - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) - #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) - #else - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #if !defined(PyUnicode_DecodeUnicodeEscape) - #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) - #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) - #endif - #if !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) - #endif - #if !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) - #endif -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#if CYTHON_COMPILING_IN_CPYTHON - #define __Pyx_PySequence_ListKeepNew(obj)\ - (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) -#else - #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) -#endif -#if PY_VERSION_HEX >= 0x030900A4 - #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) -#else - #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) -#endif -#if CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) -#else - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif -#else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef __Pyx_PyAsyncMethodsStruct - typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; - } __Pyx_PyAsyncMethodsStruct; -#endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } -#define __PYX_ERR(f_index, lineno, Ln_error) \ - { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } - -#ifdef CYTHON_EXTERN_C - #undef __PYX_EXTERN_C - #define __PYX_EXTERN_C CYTHON_EXTERN_C -#elif defined(__PYX_EXTERN_C) - #ifdef _MSC_VER - #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") - #else - #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. - #endif -#else - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__taos___cinterface -#define __PYX_HAVE_API__taos___cinterface -/* Early includes */ -#include -#include "taos.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { - return (size_t) i < (size_t) limit; -} -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) - #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif -#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -#define __Pyx_PySequence_Tuple(obj)\ - (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); -#if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_VERSION_HEX >= 0x030C00A7 - #ifndef _PyLong_SIGN_MASK - #define _PyLong_SIGN_MASK 3 - #endif - #ifndef _PyLong_NON_SIZE_BITS - #define _PyLong_NON_SIZE_BITS 3 - #endif - #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) - #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) - #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) - #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) - #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_SignedDigitCount(x)\ - ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) - #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) - #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) - #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) - #else - #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) - #endif - typedef Py_ssize_t __Pyx_compact_pylong; - typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 - #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) - #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) - #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) - #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) - #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) - #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) - #define __Pyx_PyLong_CompactValue(x)\ - ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) - typedef sdigit __Pyx_compact_pylong; - typedef digit __Pyx_compact_upylong; - #endif - #if PY_VERSION_HEX >= 0x030C00A5 - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) - #else - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) - #endif -#endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ -static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } - -#if !CYTHON_USE_MODULE_STATE -static PyObject *__pyx_m = NULL; -#endif -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; -static const char *__pyx_filename; - -/* #### Code section: filename_table ### */ - -static const char *__pyx_f[] = { - "taos\\\\_cinterface.pyx", - "", -}; -/* #### Code section: utility_code_proto_before_types ### */ -/* #### Code section: numeric_typedefs ### */ -/* #### Code section: complex_type_declarations ### */ -/* #### Code section: type_declarations ### */ - -/*--- Type declarations ---*/ -struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null; -struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch; - -/* "cfunc.to_py":66 - * - * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") - * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): # <<<<<<<<<<<<<< - * def wrap(size_t ptr, int num_of_rows, list is_null): - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" - */ -struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null { - PyObject_HEAD - PyObject *(*__pyx_v_f)(size_t, int, PyObject *); -}; - -struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch { - PyObject_HEAD - PyObject *(*__pyx_v_f)(size_t, int, PyObject *, int, PyObject *); -}; - -/* #### Code section: utility_code_proto ### */ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, Py_ssize_t); - void (*DECREF)(void*, PyObject*, Py_ssize_t); - void (*GOTREF)(void*, PyObject*, Py_ssize_t); - void (*GIVEREF)(void*, PyObject*, Py_ssize_t); - void* (*SetupContext)(const char*, Py_ssize_t, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - } - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContextNogil() - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_Py_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; Py_XDECREF(tmp);\ - } while (0) -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; -#if PY_VERSION_HEX >= 0x030C00A6 -#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) -#else -#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) -#endif -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) -#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 -#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) -#else -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#endif -#else -#define __Pyx_PyErr_Clear() PyErr_Clear() -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* PyObjectGetAttrStrNoError.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* TupleAndListFromArray.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); -static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); -#endif - -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -/* fastcall.proto */ -#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) -#define __Pyx_KwValues_VARARGS(args, nargs) NULL -#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) -#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) -#if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) - #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) - static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); - #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) -#else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS - #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS - #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS - #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS - #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS -#endif -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) -#endif - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); - -/* ArgTypeTest.proto */ -#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ - ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ - __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); - -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - -/* IncludeStructmemberH.proto */ -#include - -/* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -#endif - -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); - -/* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif - -/* PyMethodNew.proto */ -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#else - #define __Pyx_PyMethod_New PyMethod_New -#endif - -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); -#endif - -/* CythonFunctionShared.proto */ -#define __Pyx_CyFunction_USED -#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 -#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 -#define __Pyx_CYFUNCTION_CCLASS 0x04 -#define __Pyx_CYFUNCTION_COROUTINE 0x08 -#define __Pyx_CyFunction_GetClosure(f)\ - (((__pyx_CyFunctionObject *) (f))->func_closure) -#if PY_VERSION_HEX < 0x030900B1 - #define __Pyx_CyFunction_GetClassObj(f)\ - (((__pyx_CyFunctionObject *) (f))->func_classobj) -#else - #define __Pyx_CyFunction_GetClassObj(f)\ - ((PyObject*) ((PyCMethodObject *) (f))->mm_class) -#endif -#define __Pyx_CyFunction_SetClassObj(f, classobj)\ - __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) -#define __Pyx_CyFunction_Defaults(type, f)\ - ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) -#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ - ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) -typedef struct { -#if PY_VERSION_HEX < 0x030900B1 - PyCFunctionObject func; -#else - PyCMethodObject func; -#endif -#if CYTHON_BACKPORT_VECTORCALL - __pyx_vectorcallfunc func_vectorcall; -#endif -#if PY_VERSION_HEX < 0x030500A0 - PyObject *func_weakreflist; -#endif - PyObject *func_dict; - PyObject *func_name; - PyObject *func_qualname; - PyObject *func_doc; - PyObject *func_globals; - PyObject *func_code; - PyObject *func_closure; -#if PY_VERSION_HEX < 0x030900B1 - PyObject *func_classobj; -#endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults - int flags; - PyObject *defaults_tuple; - PyObject *defaults_kwdict; - PyObject *(*defaults_getter)(PyObject *); - PyObject *func_annotations; - PyObject *func_is_coroutine; -} __pyx_CyFunctionObject; -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, - PyObject *tuple); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, - PyObject *dict); -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, - PyObject *dict); -static int __pyx_CyFunction_init(PyObject *module); -#if CYTHON_METH_FASTCALL -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL -#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) -#else -#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) -#endif -#endif - -/* CythonFunction.proto */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); - -/* ListAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -/* PyIntCompare.proto */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); - -/* PyDictVersioning.proto */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif - -/* GetModuleGlobalName.proto */ -#if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) do {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ - (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ - __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ - PY_UINT64_T __pyx_dict_version;\ - PyObject *__pyx_dict_cached_value;\ - (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); -#else -#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) -#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); -#endif - -/* PySequenceContains.proto */ -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -/* SetItemInt.proto */ -#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ - __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) -static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); -static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, - int is_list, int wraparound, int boundscheck); - -/* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectFastCall.proto */ -#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); - -/* py_abs.proto */ -#if CYTHON_USE_PYLONG_INTERNALS -static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); -#define __Pyx_PyNumber_Absolute(x)\ - ((likely(PyLong_CheckExact(x))) ?\ - (likely(__Pyx_PyLong_IsNonNeg(x)) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ - PyNumber_Absolute(x)) -#else -#define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) -#endif - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* IterFinish.proto */ -static CYTHON_INLINE int __Pyx_IterFinish(void); - -/* UnpackItemEndCheck.proto */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* ListCompAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len)) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) -#endif - -/* PyObjectCallNoArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyObjectGetMethod.proto */ -static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); - -/* PyObjectCallMethod0.proto */ -static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); - -/* ValidateBasesTuple.proto */ -#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS -static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); -#endif - -/* PyType_Ready.proto */ -CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); - -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); -#endif - -/* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* GCCDiagnostics.proto */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define __Pyx_HAS_GCC_DIAGNOSTIC -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value); - -/* FormatTypeName.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -typedef PyObject *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); -#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) -#else -typedef const char *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) -#define __Pyx_DECREF_TypeName(obj) -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* FastTypeChecks.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); -#else -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) -#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) -#endif -#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* FunctionExport.proto */ -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); - -/* FunctionImport.proto */ -static int __Pyx_ImportFunction_3_0_0(PyObject *module, const char *funcname, void (**f)(void), const char *sig); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - -/* #### Code section: module_declarations ### */ - -/* Module declarations from "libc.stdint" */ - -/* Module declarations from "libcpp" */ - -/* Module declarations from "cython" */ - -/* Module declarations from "taos._parser" */ -static PyObject *(*__pyx_f_4taos_7_parser__parse_string)(size_t, int, int *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_bool)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_int8_t)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_int16_t)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_int64_t)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_uint8_t)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_uint16_t)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_uint64_t)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_int)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_uint)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_float)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_double)(size_t, int, PyObject *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_timestamp)(size_t, int, PyObject *, int, PyObject *); /*proto*/ - -/* Module declarations from "taos._cinterface" */ -static PyObject *__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(TAOS_RES *, int, int); /*proto*/ -static PyObject *__pyx_f_4taos_11_cinterface_taos_fetch_block_v3(TAOS_RES *, TAOS_FIELD *, int, PyObject *); /*proto*/ -static PyObject *__pyx_f_4taos_11_cinterface_fetch_all(size_t, PyObject *, int __pyx_skip_dispatch); /*proto*/ -static PyObject *__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyObject *(*)(size_t, int, PyObject *)); /*proto*/ -static PyObject *__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyObject *(*)(size_t, int, PyObject *, int, PyObject *)); /*proto*/ -/* #### Code section: typeinfo ### */ -/* #### Code section: before_global_var ### */ -#define __Pyx_MODULE_NAME "taos._cinterface" -extern int __pyx_module_is_main_taos___cinterface; -int __pyx_module_is_main_taos___cinterface = 0; - -/* Implementation of "taos._cinterface" */ -/* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_map; -static PyObject *__pyx_builtin_zip; -/* #### Code section: string_decls ### */ -static const char __pyx_k__6[] = "*"; -static const char __pyx_k__7[] = "."; -static const char __pyx_k__9[] = "?"; -static const char __pyx_k_dt[] = "dt"; -static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k_map[] = "map"; -static const char __pyx_k_ptr[] = "ptr"; -static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_pytz[] = "pytz"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_wrap[] = "wrap"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_disable[] = "disable"; -static const char __pyx_k_is_null[] = "is_null"; -static const char __pyx_k_datetime[] = "datetime"; -static const char __pyx_k_dt_epoch[] = "dt_epoch"; -static const char __pyx_k_fetch_all[] = "fetch_all"; -static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_precision[] = "precision"; -static const char __pyx_k_SIZED_TYPE[] = "SIZED_TYPE"; -static const char __pyx_k_namedtuple[] = "namedtuple"; -static const char __pyx_k_taos_error[] = "taos.error"; -static const char __pyx_k_cfunc_to_py[] = "cfunc.to_py"; -static const char __pyx_k_collections[] = "collections"; -static const char __pyx_k_num_of_rows[] = "num_of_rows"; -static const char __pyx_k_CONVERT_FUNC[] = "CONVERT_FUNC"; -static const char __pyx_k_UNSIZED_TYPE[] = "UNSIZED_TYPE"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_stringsource[] = ""; -static const char __pyx_k_DatabaseError[] = "DatabaseError"; -static const char __pyx_k_InternalError[] = "InternalError"; -static const char __pyx_k_StatementError[] = "StatementError"; -static const char __pyx_k_ConnectionError[] = "ConnectionError"; -static const char __pyx_k_OperationalError[] = "OperationalError"; -static const char __pyx_k_ProgrammingError[] = "ProgrammingError"; -static const char __pyx_k_taos__cinterface[] = "taos._cinterface"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_taos__cinterface_pyx[] = "taos\\_cinterface.pyx"; -static const char __pyx_k_Pyx_CFunc_list__lParensize_t[] = "__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null..wrap"; -static const char __pyx_k_Pyx_CFunc_a4beef__list__lParen[] = "__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch..wrap"; -/* #### Code section: decls ### */ -static PyObject *__pyx_pf_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap(PyObject *__pyx_self, size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null); /* proto */ -static PyObject *__pyx_pf_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap(PyObject *__pyx_self, size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null, int __pyx_v_precision, PyObject *__pyx_v_dt_epoch); /* proto */ -static PyObject *__pyx_pf_4taos_11_cinterface_fetch_all(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_ptr, PyObject *__pyx_v_dt_epoch); /* proto */ -static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -/* #### Code section: late_includes ### */ -/* #### Code section: module_state ### */ -typedef struct { - PyObject *__pyx_d; - PyObject *__pyx_b; - PyObject *__pyx_cython_runtime; - PyObject *__pyx_empty_tuple; - PyObject *__pyx_empty_bytes; - PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - PyObject *__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null; - PyObject *__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch; - #endif - PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null; - PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch; - PyObject *__pyx_n_s_CONVERT_FUNC; - PyObject *__pyx_n_s_ConnectionError; - PyObject *__pyx_n_s_DatabaseError; - PyObject *__pyx_n_s_InternalError; - PyObject *__pyx_n_s_OperationalError; - PyObject *__pyx_n_s_ProgrammingError; - PyObject *__pyx_n_s_Pyx_CFunc_a4beef__list__lParen; - PyObject *__pyx_n_s_Pyx_CFunc_list__lParensize_t; - PyObject *__pyx_n_s_SIZED_TYPE; - PyObject *__pyx_n_s_StatementError; - PyObject *__pyx_n_s_UNSIZED_TYPE; - PyObject *__pyx_n_s__6; - PyObject *__pyx_kp_u__7; - PyObject *__pyx_n_s__9; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_cfunc_to_py; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_collections; - PyObject *__pyx_n_s_datetime; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_dt; - PyObject *__pyx_n_s_dt_epoch; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_fetch_all; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_s_is_null; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_map; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_namedtuple; - PyObject *__pyx_n_s_num_of_rows; - PyObject *__pyx_n_s_precision; - PyObject *__pyx_n_s_ptr; - PyObject *__pyx_n_s_pytz; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_kp_s_stringsource; - PyObject *__pyx_n_s_taos__cinterface; - PyObject *__pyx_kp_s_taos__cinterface_pyx; - PyObject *__pyx_n_s_taos_error; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_wrap; - PyObject *__pyx_n_s_zip; - PyObject *__pyx_int_0; - PyObject *__pyx_tuple_; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__8; - PyObject *__pyx_codeobj__2; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__5; -} __pyx_mstate; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { - extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstate __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - Py_CLEAR(clear_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null); - Py_CLEAR(clear_module_state->__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null); - Py_CLEAR(clear_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch); - Py_CLEAR(clear_module_state->__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch); - Py_CLEAR(clear_module_state->__pyx_n_s_CONVERT_FUNC); - Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionError); - Py_CLEAR(clear_module_state->__pyx_n_s_DatabaseError); - Py_CLEAR(clear_module_state->__pyx_n_s_InternalError); - Py_CLEAR(clear_module_state->__pyx_n_s_OperationalError); - Py_CLEAR(clear_module_state->__pyx_n_s_ProgrammingError); - Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_CFunc_a4beef__list__lParen); - Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_CFunc_list__lParensize_t); - Py_CLEAR(clear_module_state->__pyx_n_s_SIZED_TYPE); - Py_CLEAR(clear_module_state->__pyx_n_s_StatementError); - Py_CLEAR(clear_module_state->__pyx_n_s_UNSIZED_TYPE); - Py_CLEAR(clear_module_state->__pyx_n_s__6); - Py_CLEAR(clear_module_state->__pyx_kp_u__7); - Py_CLEAR(clear_module_state->__pyx_n_s__9); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_cfunc_to_py); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_collections); - Py_CLEAR(clear_module_state->__pyx_n_s_datetime); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_dt); - Py_CLEAR(clear_module_state->__pyx_n_s_dt_epoch); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_fetch_all); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_s_is_null); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_map); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_namedtuple); - Py_CLEAR(clear_module_state->__pyx_n_s_num_of_rows); - Py_CLEAR(clear_module_state->__pyx_n_s_precision); - Py_CLEAR(clear_module_state->__pyx_n_s_ptr); - Py_CLEAR(clear_module_state->__pyx_n_s_pytz); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); - Py_CLEAR(clear_module_state->__pyx_n_s_taos__cinterface); - Py_CLEAR(clear_module_state->__pyx_kp_s_taos__cinterface_pyx); - Py_CLEAR(clear_module_state->__pyx_n_s_taos_error); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_wrap); - Py_CLEAR(clear_module_state->__pyx_n_s_zip); - Py_CLEAR(clear_module_state->__pyx_int_0); - Py_CLEAR(clear_module_state->__pyx_tuple_); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_codeobj__2); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__5); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif - Py_VISIT(traverse_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null); - Py_VISIT(traverse_module_state->__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null); - Py_VISIT(traverse_module_state->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch); - Py_VISIT(traverse_module_state->__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch); - Py_VISIT(traverse_module_state->__pyx_n_s_CONVERT_FUNC); - Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionError); - Py_VISIT(traverse_module_state->__pyx_n_s_DatabaseError); - Py_VISIT(traverse_module_state->__pyx_n_s_InternalError); - Py_VISIT(traverse_module_state->__pyx_n_s_OperationalError); - Py_VISIT(traverse_module_state->__pyx_n_s_ProgrammingError); - Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_CFunc_a4beef__list__lParen); - Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_CFunc_list__lParensize_t); - Py_VISIT(traverse_module_state->__pyx_n_s_SIZED_TYPE); - Py_VISIT(traverse_module_state->__pyx_n_s_StatementError); - Py_VISIT(traverse_module_state->__pyx_n_s_UNSIZED_TYPE); - Py_VISIT(traverse_module_state->__pyx_n_s__6); - Py_VISIT(traverse_module_state->__pyx_kp_u__7); - Py_VISIT(traverse_module_state->__pyx_n_s__9); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_cfunc_to_py); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_collections); - Py_VISIT(traverse_module_state->__pyx_n_s_datetime); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_dt); - Py_VISIT(traverse_module_state->__pyx_n_s_dt_epoch); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_fetch_all); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_s_is_null); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_map); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_namedtuple); - Py_VISIT(traverse_module_state->__pyx_n_s_num_of_rows); - Py_VISIT(traverse_module_state->__pyx_n_s_precision); - Py_VISIT(traverse_module_state->__pyx_n_s_ptr); - Py_VISIT(traverse_module_state->__pyx_n_s_pytz); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); - Py_VISIT(traverse_module_state->__pyx_n_s_taos__cinterface); - Py_VISIT(traverse_module_state->__pyx_kp_s_taos__cinterface_pyx); - Py_VISIT(traverse_module_state->__pyx_n_s_taos_error); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_wrap); - Py_VISIT(traverse_module_state->__pyx_n_s_zip); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_tuple_); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_codeobj__2); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__5); - return 0; -} -#endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null __pyx_mstate_global->__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null -#define __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch __pyx_mstate_global->__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch -#endif -#define __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null __pyx_mstate_global->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null -#define __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch __pyx_mstate_global->__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch -#define __pyx_n_s_CONVERT_FUNC __pyx_mstate_global->__pyx_n_s_CONVERT_FUNC -#define __pyx_n_s_ConnectionError __pyx_mstate_global->__pyx_n_s_ConnectionError -#define __pyx_n_s_DatabaseError __pyx_mstate_global->__pyx_n_s_DatabaseError -#define __pyx_n_s_InternalError __pyx_mstate_global->__pyx_n_s_InternalError -#define __pyx_n_s_OperationalError __pyx_mstate_global->__pyx_n_s_OperationalError -#define __pyx_n_s_ProgrammingError __pyx_mstate_global->__pyx_n_s_ProgrammingError -#define __pyx_n_s_Pyx_CFunc_a4beef__list__lParen __pyx_mstate_global->__pyx_n_s_Pyx_CFunc_a4beef__list__lParen -#define __pyx_n_s_Pyx_CFunc_list__lParensize_t __pyx_mstate_global->__pyx_n_s_Pyx_CFunc_list__lParensize_t -#define __pyx_n_s_SIZED_TYPE __pyx_mstate_global->__pyx_n_s_SIZED_TYPE -#define __pyx_n_s_StatementError __pyx_mstate_global->__pyx_n_s_StatementError -#define __pyx_n_s_UNSIZED_TYPE __pyx_mstate_global->__pyx_n_s_UNSIZED_TYPE -#define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 -#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 -#define __pyx_n_s__9 __pyx_mstate_global->__pyx_n_s__9 -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_cfunc_to_py __pyx_mstate_global->__pyx_n_s_cfunc_to_py -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections -#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_dt __pyx_mstate_global->__pyx_n_s_dt -#define __pyx_n_s_dt_epoch __pyx_mstate_global->__pyx_n_s_dt_epoch -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_fetch_all __pyx_mstate_global->__pyx_n_s_fetch_all -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_is_null __pyx_mstate_global->__pyx_n_s_is_null -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_namedtuple __pyx_mstate_global->__pyx_n_s_namedtuple -#define __pyx_n_s_num_of_rows __pyx_mstate_global->__pyx_n_s_num_of_rows -#define __pyx_n_s_precision __pyx_mstate_global->__pyx_n_s_precision -#define __pyx_n_s_ptr __pyx_mstate_global->__pyx_n_s_ptr -#define __pyx_n_s_pytz __pyx_mstate_global->__pyx_n_s_pytz -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource -#define __pyx_n_s_taos__cinterface __pyx_mstate_global->__pyx_n_s_taos__cinterface -#define __pyx_kp_s_taos__cinterface_pyx __pyx_mstate_global->__pyx_kp_s_taos__cinterface_pyx -#define __pyx_n_s_taos_error __pyx_mstate_global->__pyx_n_s_taos_error -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_wrap __pyx_mstate_global->__pyx_n_s_wrap -#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 -/* #### Code section: module_code ### */ - -/* "cfunc.to_py":67 - * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") - * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): - * def wrap(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" - * return f(ptr, num_of_rows, is_null) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap, "wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list"); -static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap = {"wrap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap}; -static PyObject *__pyx_pw_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - size_t __pyx_v_ptr; - int __pyx_v_num_of_rows; - PyObject *__pyx_v_is_null = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wrap (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptr,&__pyx_n_s_num_of_rows,&__pyx_n_s_is_null,0}; - PyObject* values[3] = {0,0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptr)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_num_of_rows)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 1); __PYX_ERR(1, 67, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_null)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 2); __PYX_ERR(1, 67, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wrap") < 0)) __PYX_ERR(1, 67, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_ptr = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_ptr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - __pyx_v_num_of_rows = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_of_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - __pyx_v_is_null = ((PyObject*)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 67, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_null), (&PyList_Type), 1, "is_null", 1))) __PYX_ERR(1, 67, __pyx_L1_error) - __pyx_r = __pyx_pf_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap(__pyx_self, __pyx_v_ptr, __pyx_v_num_of_rows, __pyx_v_is_null); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_wrap(PyObject *__pyx_self, size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *__pyx_cur_scope; - struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *__pyx_outer_scope; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("wrap", 0); - __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - __Pyx_TraceCall("wrap", __pyx_f[1], 67, 0, __PYX_ERR(1, 67, __pyx_L1_error)); - - /* "cfunc.to_py":69 - * def wrap(size_t ptr, int num_of_rows, list is_null): - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" - * return f(ptr, num_of_rows, is_null) # <<<<<<<<<<<<<< - * return wrap - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_ptr, __pyx_v_num_of_rows, __pyx_v_is_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "cfunc.to_py":67 - * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") - * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): - * def wrap(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" - * return f(ptr, num_of_rows, is_null) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "cfunc.to_py":66 - * - * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") - * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): # <<<<<<<<<<<<<< - * def wrap(size_t ptr, int num_of_rows, list is_null): - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" - */ - -static PyObject *__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyObject *(*__pyx_v_f)(size_t, int, PyObject *)) { - struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *__pyx_cur_scope; - PyObject *__pyx_v_wrap = 0; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", 0); - __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(1, 66, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __Pyx_TraceCall("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", __pyx_f[1], 66, 0, __PYX_ERR(1, 66, __pyx_L1_error)); - __pyx_cur_scope->__pyx_v_f = __pyx_v_f; - - /* "cfunc.to_py":67 - * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") - * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): - * def wrap(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" - * return f(ptr, num_of_rows, is_null) - */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_95__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_1wrap, 0, __pyx_n_s_Pyx_CFunc_list__lParensize_t, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_wrap = __pyx_t_1; - __pyx_t_1 = 0; - - /* "cfunc.to_py":70 - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" - * return f(ptr, num_of_rows, is_null) - * return wrap # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_wrap); - __pyx_r = __pyx_v_wrap; - goto __pyx_L0; - - /* "cfunc.to_py":66 - * - * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") - * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): # <<<<<<<<<<<<<< - * def wrap(size_t ptr, int num_of_rows, list is_null): - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_wrap); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "cfunc.to_py":67 - * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") - * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): - * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): # <<<<<<<<<<<<<< - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" - * return f(ptr, num_of_rows, is_null, precision, dt_epoch) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap, "wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list"); -static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap = {"wrap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap}; -static PyObject *__pyx_pw_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - size_t __pyx_v_ptr; - int __pyx_v_num_of_rows; - PyObject *__pyx_v_is_null = 0; - int __pyx_v_precision; - PyObject *__pyx_v_dt_epoch = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("wrap (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptr,&__pyx_n_s_num_of_rows,&__pyx_n_s_is_null,&__pyx_n_s_precision,&__pyx_n_s_dt_epoch,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptr)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_num_of_rows)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, 1); __PYX_ERR(1, 67, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_is_null)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, 2); __PYX_ERR(1, 67, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, 3); __PYX_ERR(1, 67, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dt_epoch)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, 4); __PYX_ERR(1, 67, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wrap") < 0)) __PYX_ERR(1, 67, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 5)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - } - __pyx_v_ptr = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_ptr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - __pyx_v_num_of_rows = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_of_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - __pyx_v_is_null = ((PyObject*)values[2]); - __pyx_v_precision = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_precision == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error) - __pyx_v_dt_epoch = values[4]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("wrap", 1, 5, 5, __pyx_nargs); __PYX_ERR(1, 67, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_null), (&PyList_Type), 1, "is_null", 1))) __PYX_ERR(1, 67, __pyx_L1_error) - __pyx_r = __pyx_pf_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap(__pyx_self, __pyx_v_ptr, __pyx_v_num_of_rows, __pyx_v_is_null, __pyx_v_precision, __pyx_v_dt_epoch); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_wrap(PyObject *__pyx_self, size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null, int __pyx_v_precision, PyObject *__pyx_v_dt_epoch) { - struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *__pyx_cur_scope; - struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *__pyx_outer_scope; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("wrap", 0); - __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - __Pyx_TraceCall("wrap", __pyx_f[1], 67, 0, __PYX_ERR(1, 67, __pyx_L1_error)); - - /* "cfunc.to_py":69 - * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" - * return f(ptr, num_of_rows, is_null, precision, dt_epoch) # <<<<<<<<<<<<<< - * return wrap - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_ptr, __pyx_v_num_of_rows, __pyx_v_is_null, __pyx_v_precision, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "cfunc.to_py":67 - * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") - * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): - * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): # <<<<<<<<<<<<<< - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" - * return f(ptr, num_of_rows, is_null, precision, dt_epoch) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "cfunc.to_py":66 - * - * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") - * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): # <<<<<<<<<<<<<< - * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" - */ - -static PyObject *__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyObject *(*__pyx_v_f)(size_t, int, PyObject *, int, PyObject *)) { - struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *__pyx_cur_scope; - PyObject *__pyx_v_wrap = 0; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", 0); - __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(1, 66, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __Pyx_TraceCall("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", __pyx_f[1], 66, 0, __PYX_ERR(1, 66, __pyx_L1_error)); - __pyx_cur_scope->__pyx_v_f = __pyx_v_f; - - /* "cfunc.to_py":67 - * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") - * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): - * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): # <<<<<<<<<<<<<< - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" - * return f(ptr, num_of_rows, is_null, precision, dt_epoch) - */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cfunc_dot_to_py_154__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_1wrap, 0, __pyx_n_s_Pyx_CFunc_a4beef__list__lParen, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_wrap = __pyx_t_1; - __pyx_t_1 = 0; - - /* "cfunc.to_py":70 - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" - * return f(ptr, num_of_rows, is_null, precision, dt_epoch) - * return wrap # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_wrap); - __pyx_r = __pyx_v_wrap; - goto __pyx_L0; - - /* "cfunc.to_py":66 - * - * @cname("__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch") - * cdef object __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(list (*f)(size_t, int, list, int, object) ): # <<<<<<<<<<<<<< - * def wrap(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch): - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list, precision: 'int', dt_epoch) -> list""" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_wrap); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_cinterface.pyx":11 - * _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string) - * - * cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): # <<<<<<<<<<<<<< - * cdef list is_null = [] - * cdef int r - */ - -static PyObject *__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(TAOS_RES *__pyx_v_res, int __pyx_v_field, int __pyx_v_rows) { - PyObject *__pyx_v_is_null = 0; - int __pyx_v_r; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("taos_get_column_data_is_null", 0); - __Pyx_TraceCall("taos_get_column_data_is_null", __pyx_f[0], 11, 0, __PYX_ERR(0, 11, __pyx_L1_error)); - - /* "taos/_cinterface.pyx":12 - * - * cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): - * cdef list is_null = [] # <<<<<<<<<<<<<< - * cdef int r - * for r in range(rows): - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_is_null = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_cinterface.pyx":14 - * cdef list is_null = [] - * cdef int r - * for r in range(rows): # <<<<<<<<<<<<<< - * is_null.append(taos_is_null(res, r, field)) - * - */ - __pyx_t_2 = __pyx_v_rows; - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_r = __pyx_t_4; - - /* "taos/_cinterface.pyx":15 - * cdef int r - * for r in range(rows): - * is_null.append(taos_is_null(res, r, field)) # <<<<<<<<<<<<<< - * - * return is_null - */ - __pyx_t_1 = __Pyx_PyBool_FromLong(taos_is_null(__pyx_v_res, __pyx_v_r, __pyx_v_field)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_is_null, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "taos/_cinterface.pyx":17 - * is_null.append(taos_is_null(res, r, field)) - * - * return is_null # <<<<<<<<<<<<<< - * - * # --------------------------------------------- parser ---------------------------------------------------------------v - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_is_null); - __pyx_r = __pyx_v_is_null; - goto __pyx_L0; - - /* "taos/_cinterface.pyx":11 - * _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string) - * - * cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): # <<<<<<<<<<<<<< - * cdef list is_null = [] - * cdef int r - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._cinterface.taos_get_column_data_is_null", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_is_null); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_cinterface.pyx":70 - * - * - * cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch): # <<<<<<<<<<<<<< - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(res, &pblock) - */ - -static PyObject *__pyx_f_4taos_11_cinterface_taos_fetch_block_v3(TAOS_RES *__pyx_v_res, TAOS_FIELD *__pyx_v_fields, int __pyx_v_field_count, PyObject *__pyx_v_dt_epoch) { - TAOS_ROW __pyx_v_pblock; - PyObject *__pyx_v_num_of_rows = NULL; - int __pyx_v_precision; - PyObject *__pyx_v_blocks = NULL; - int __pyx_v_i; - void *__pyx_v_data; - TAOS_FIELD __pyx_v_field; - int *__pyx_v_offsets; - PyObject *__pyx_v_is_null = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int8_t __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("taos_fetch_block_v3", 0); - __Pyx_TraceCall("taos_fetch_block_v3", __pyx_f[0], 70, 0, __PYX_ERR(0, 70, __pyx_L1_error)); - - /* "taos/_cinterface.pyx":72 - * cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch): - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(res, &pblock) # <<<<<<<<<<<<<< - * if num_of_rows == 0: - * return [], 0 - */ - __pyx_t_1 = __Pyx_PyInt_From_int(taos_fetch_block(__pyx_v_res, (&__pyx_v_pblock))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_num_of_rows = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_cinterface.pyx":73 - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(res, &pblock) - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * return [], 0 - * - */ - __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 73, __pyx_L1_error) - if (__pyx_t_2) { - - /* "taos/_cinterface.pyx":74 - * num_of_rows = taos_fetch_block(res, &pblock) - * if num_of_rows == 0: - * return [], 0 # <<<<<<<<<<<<<< - * - * precision = taos_result_precision(res) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "taos/_cinterface.pyx":73 - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(res, &pblock) - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * return [], 0 - * - */ - } - - /* "taos/_cinterface.pyx":76 - * return [], 0 - * - * precision = taos_result_precision(res) # <<<<<<<<<<<<<< - * blocks = [None] * field_count - * - */ - __pyx_v_precision = taos_result_precision(__pyx_v_res); - - /* "taos/_cinterface.pyx":77 - * - * precision = taos_result_precision(res) - * blocks = [None] * field_count # <<<<<<<<<<<<<< - * - * cdef int i - */ - __pyx_t_3 = PyList_New(1 * ((__pyx_v_field_count<0) ? 0:__pyx_v_field_count)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < __pyx_v_field_count; __pyx_temp++) { - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None); - } - } - __pyx_v_blocks = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "taos/_cinterface.pyx":80 - * - * cdef int i - * for i in range(field_count): # <<<<<<<<<<<<<< - * data = pblock[i] - * field = fields[i] - */ - __pyx_t_4 = __pyx_v_field_count; - __pyx_t_5 = __pyx_t_4; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { - __pyx_v_i = __pyx_t_6; - - /* "taos/_cinterface.pyx":81 - * cdef int i - * for i in range(field_count): - * data = pblock[i] # <<<<<<<<<<<<<< - * field = fields[i] - * - */ - __pyx_v_data = (__pyx_v_pblock[__pyx_v_i]); - - /* "taos/_cinterface.pyx":82 - * for i in range(field_count): - * data = pblock[i] - * field = fields[i] # <<<<<<<<<<<<<< - * - * if field.type in UNSIZED_TYPE: - */ - __pyx_v_field = (__pyx_v_fields[__pyx_v_i]); - - /* "taos/_cinterface.pyx":84 - * field = fields[i] - * - * if field.type in UNSIZED_TYPE: # <<<<<<<<<<<<<< - * offsets = taos_get_column_data_offset(res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) - */ - __pyx_t_3 = __Pyx_PyInt_From_int8_t(__pyx_v_field.type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UNSIZED_TYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "taos/_cinterface.pyx":85 - * - * if field.type in UNSIZED_TYPE: - * offsets = taos_get_column_data_offset(res, i) # <<<<<<<<<<<<<< - * blocks[i] = _parse_string(data, num_of_rows, offsets) - * elif field.type in SIZED_TYPE: - */ - __pyx_v_offsets = taos_get_column_data_offset(__pyx_v_res, __pyx_v_i); - - /* "taos/_cinterface.pyx":86 - * if field.type in UNSIZED_TYPE: - * offsets = taos_get_column_data_offset(res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) # <<<<<<<<<<<<<< - * elif field.type in SIZED_TYPE: - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) - __pyx_t_1 = __pyx_f_4taos_7_parser__parse_string(((size_t)__pyx_v_data), __pyx_t_7, __pyx_v_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_cinterface.pyx":84 - * field = fields[i] - * - * if field.type in UNSIZED_TYPE: # <<<<<<<<<<<<<< - * offsets = taos_get_column_data_offset(res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) - */ - goto __pyx_L6; - } - - /* "taos/_cinterface.pyx":87 - * offsets = taos_get_column_data_offset(res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) - * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - */ - __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_field.type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "taos/_cinterface.pyx":88 - * blocks[i] = _parse_string(data, num_of_rows, offsets) - * elif field.type in SIZED_TYPE: - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) # <<<<<<<<<<<<<< - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_3 = __pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(__pyx_v_res, __pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_is_null, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "taos/_cinterface.pyx":89 - * elif field.type in SIZED_TYPE: - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) # <<<<<<<<<<<<<< - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CONVERT_FUNC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_field.type, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_1, __pyx_v_num_of_rows, __pyx_v_is_null}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_cinterface.pyx":87 - * offsets = taos_get_column_data_offset(res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) - * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - */ - goto __pyx_L6; - } - - /* "taos/_cinterface.pyx":90 - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) - */ - __pyx_t_10 = __pyx_v_field.type; - __pyx_t_2 = (__pyx_t_10 == TSDB_DATA_TYPE_TIMESTAMP); - if (__pyx_t_2) { - - /* "taos/_cinterface.pyx":91 - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) # <<<<<<<<<<<<<< - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) - * else: - */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) - __pyx_t_3 = __pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(__pyx_v_res, __pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_is_null, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "taos/_cinterface.pyx":92 - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) # <<<<<<<<<<<<<< - * else: - * pass - */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) - __pyx_t_3 = __pyx_f_4taos_7_parser__parse_timestamp(((size_t)__pyx_v_data), __pyx_t_7, __pyx_v_is_null, __pyx_v_precision, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_cinterface.pyx":90 - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< - * is_null = taos_get_column_data_is_null(res, i, num_of_rows) - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) - */ - goto __pyx_L6; - } - - /* "taos/_cinterface.pyx":94 - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) - * else: - * pass # <<<<<<<<<<<<<< - * - * return blocks, abs(num_of_rows) - */ - /*else*/ { - } - __pyx_L6:; - } - - /* "taos/_cinterface.pyx":96 - * pass - * - * return blocks, abs(num_of_rows) # <<<<<<<<<<<<<< - * - * cpdef fetch_all(size_t ptr, dt_epoch): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_num_of_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_v_blocks); - __Pyx_GIVEREF(__pyx_v_blocks); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_blocks); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L0; - - /* "taos/_cinterface.pyx":70 - * - * - * cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_epoch): # <<<<<<<<<<<<<< - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(res, &pblock) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("taos._cinterface.taos_fetch_block_v3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_num_of_rows); - __Pyx_XDECREF(__pyx_v_blocks); - __Pyx_XDECREF(__pyx_v_is_null); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_cinterface.pyx":98 - * return blocks, abs(num_of_rows) - * - * cpdef fetch_all(size_t ptr, dt_epoch): # <<<<<<<<<<<<<< - * res = ptr - * fields = taos_fetch_fields(res) - */ - -static PyObject *__pyx_pw_4taos_11_cinterface_1fetch_all(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyObject *__pyx_f_4taos_11_cinterface_fetch_all(size_t __pyx_v_ptr, PyObject *__pyx_v_dt_epoch, CYTHON_UNUSED int __pyx_skip_dispatch) { - TAOS_RES *__pyx_v_res; - TAOS_FIELD *__pyx_v_fields; - int __pyx_v_field_count; - PyObject *__pyx_v_chunks = NULL; - int __pyx_v_row_count; - PyObject *__pyx_v_block = NULL; - PyObject *__pyx_v_num_of_rows = NULL; - int __pyx_v_errno; - PyObject *__pyx_7genexpr__pyx_v_chunk = NULL; - PyObject *__pyx_7genexpr__pyx_v_row = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *(*__pyx_t_5)(PyObject *); - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - PyObject *(*__pyx_t_12)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__5) - __Pyx_RefNannySetupContext("fetch_all", 0); - __Pyx_TraceCall("fetch_all", __pyx_f[0], 98, 0, __PYX_ERR(0, 98, __pyx_L1_error)); - - /* "taos/_cinterface.pyx":99 - * - * cpdef fetch_all(size_t ptr, dt_epoch): - * res = ptr # <<<<<<<<<<<<<< - * fields = taos_fetch_fields(res) - * field_count = taos_field_count(res) - */ - __pyx_v_res = ((TAOS_RES *)__pyx_v_ptr); - - /* "taos/_cinterface.pyx":100 - * cpdef fetch_all(size_t ptr, dt_epoch): - * res = ptr - * fields = taos_fetch_fields(res) # <<<<<<<<<<<<<< - * field_count = taos_field_count(res) - * - */ - __pyx_v_fields = taos_fetch_fields(__pyx_v_res); - - /* "taos/_cinterface.pyx":101 - * res = ptr - * fields = taos_fetch_fields(res) - * field_count = taos_field_count(res) # <<<<<<<<<<<<<< - * - * chunks = [] - */ - __pyx_v_field_count = taos_field_count(__pyx_v_res); - - /* "taos/_cinterface.pyx":103 - * field_count = taos_field_count(res) - * - * chunks = [] # <<<<<<<<<<<<<< - * cdef int row_count = 0 - * while True: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_chunks = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_cinterface.pyx":104 - * - * chunks = [] - * cdef int row_count = 0 # <<<<<<<<<<<<<< - * while True: - * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) - */ - __pyx_v_row_count = 0; - - /* "taos/_cinterface.pyx":105 - * chunks = [] - * cdef int row_count = 0 - * while True: # <<<<<<<<<<<<<< - * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) - * errno = taos_errno(res) - */ - while (1) { - - /* "taos/_cinterface.pyx":106 - * cdef int row_count = 0 - * while True: - * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) # <<<<<<<<<<<<<< - * errno = taos_errno(res) - * - */ - __pyx_t_1 = __pyx_f_4taos_11_cinterface_taos_fetch_block_v3(__pyx_v_res, __pyx_v_fields, __pyx_v_field_count, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 106, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); - index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 106, __pyx_L1_error) - __pyx_t_5 = NULL; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6_unpacking_done; - __pyx_L5_unpacking_failed:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 106, __pyx_L1_error) - __pyx_L6_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_block, __pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_num_of_rows, __pyx_t_3); - __pyx_t_3 = 0; - - /* "taos/_cinterface.pyx":107 - * while True: - * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) - * errno = taos_errno(res) # <<<<<<<<<<<<<< - * - * if errno != 0: - */ - __pyx_v_errno = taos_errno(__pyx_v_res); - - /* "taos/_cinterface.pyx":109 - * errno = taos_errno(res) - * - * if errno != 0: # <<<<<<<<<<<<<< - * raise ProgrammingError(taos_errstr(res), errno) - * - */ - __pyx_t_6 = (__pyx_v_errno != 0); - if (unlikely(__pyx_t_6)) { - - /* "taos/_cinterface.pyx":110 - * - * if errno != 0: - * raise ProgrammingError(taos_errstr(res), errno) # <<<<<<<<<<<<<< - * - * if num_of_rows == 0: - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyBytes_FromString(taos_errstr(__pyx_v_res)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_8 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_2, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 110, __pyx_L1_error) - - /* "taos/_cinterface.pyx":109 - * errno = taos_errno(res) - * - * if errno != 0: # <<<<<<<<<<<<<< - * raise ProgrammingError(taos_errstr(res), errno) - * - */ - } - - /* "taos/_cinterface.pyx":112 - * raise ProgrammingError(taos_errstr(res), errno) - * - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * break - * - */ - __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 112, __pyx_L1_error) - if (__pyx_t_6) { - - /* "taos/_cinterface.pyx":113 - * - * if num_of_rows == 0: - * break # <<<<<<<<<<<<<< - * - * row_count += num_of_rows - */ - goto __pyx_L4_break; - - /* "taos/_cinterface.pyx":112 - * raise ProgrammingError(taos_errstr(res), errno) - * - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * break - * - */ - } - - /* "taos/_cinterface.pyx":115 - * break - * - * row_count += num_of_rows # <<<<<<<<<<<<<< - * chunks.append(block) - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_row_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_num_of_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_row_count = __pyx_t_8; - - /* "taos/_cinterface.pyx":116 - * - * row_count += num_of_rows - * chunks.append(block) # <<<<<<<<<<<<<< - * - * return [row for chunk in chunks for row in map(tuple, zip(*chunk))] - */ - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_chunks, __pyx_v_block); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error) - } - __pyx_L4_break:; - - /* "taos/_cinterface.pyx":118 - * chunks.append(block) - * - * return [row for chunk in chunks for row in map(tuple, zip(*chunk))] # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_v_chunks; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; - for (;;) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 118, __pyx_L11_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_chunk, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_7genexpr__pyx_v_chunk); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF((PyObject *)(&PyTuple_Type)); - __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; - __pyx_t_12 = NULL; - } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L11_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 118, __pyx_L11_error) - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } else { - if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 118, __pyx_L11_error) - #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } - } else { - __pyx_t_2 = __pyx_t_12(__pyx_t_4); - if (unlikely(!__pyx_t_2)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 118, __pyx_L11_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_row, __pyx_t_2); - __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_7genexpr__pyx_v_row))) __PYX_ERR(0, 118, __pyx_L11_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_7genexpr__pyx_v_chunk); __pyx_7genexpr__pyx_v_chunk = 0; - __Pyx_XDECREF(__pyx_7genexpr__pyx_v_row); __pyx_7genexpr__pyx_v_row = 0; - goto __pyx_L18_exit_scope; - __pyx_L11_error:; - __Pyx_XDECREF(__pyx_7genexpr__pyx_v_chunk); __pyx_7genexpr__pyx_v_chunk = 0; - __Pyx_XDECREF(__pyx_7genexpr__pyx_v_row); __pyx_7genexpr__pyx_v_row = 0; - goto __pyx_L1_error; - __pyx_L18_exit_scope:; - } /* exit inner scope */ - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "taos/_cinterface.pyx":98 - * return blocks, abs(num_of_rows) - * - * cpdef fetch_all(size_t ptr, dt_epoch): # <<<<<<<<<<<<<< - * res = ptr - * fields = taos_fetch_fields(res) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("taos._cinterface.fetch_all", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_chunks); - __Pyx_XDECREF(__pyx_v_block); - __Pyx_XDECREF(__pyx_v_num_of_rows); - __Pyx_XDECREF(__pyx_7genexpr__pyx_v_chunk); - __Pyx_XDECREF(__pyx_7genexpr__pyx_v_row); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_11_cinterface_1fetch_all(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_11_cinterface_fetch_all, "fetch_all(size_t ptr, dt_epoch)"); -static PyMethodDef __pyx_mdef_4taos_11_cinterface_1fetch_all = {"fetch_all", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_11_cinterface_1fetch_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_11_cinterface_fetch_all}; -static PyObject *__pyx_pw_4taos_11_cinterface_1fetch_all(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - size_t __pyx_v_ptr; - PyObject *__pyx_v_dt_epoch = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fetch_all (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptr,&__pyx_n_s_dt_epoch,0}; - PyObject* values[2] = {0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ptr)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dt_epoch)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("fetch_all", 1, 2, 2, 1); __PYX_ERR(0, 98, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetch_all") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_ptr = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_ptr == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error) - __pyx_v_dt_epoch = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fetch_all", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._cinterface.fetch_all", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_11_cinterface_fetch_all(__pyx_self, __pyx_v_ptr, __pyx_v_dt_epoch); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_11_cinterface_fetch_all(CYTHON_UNUSED PyObject *__pyx_self, size_t __pyx_v_ptr, PyObject *__pyx_v_dt_epoch) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__5) - __Pyx_RefNannySetupContext("fetch_all", 0); - __Pyx_TraceCall("fetch_all (wrapper)", __pyx_f[0], 98, 0, __PYX_ERR(0, 98, __pyx_L1_error)); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4taos_11_cinterface_fetch_all(__pyx_v_ptr, __pyx_v_dt_epoch, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __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("taos._cinterface.fetch_all", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null[8]; -static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null = 0; - -static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null)))) { - o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null]; - memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null)); - (void) PyObject_INIT(o, t); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - #endif - return o; -} - -static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(PyObject *o) { - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null)))) { - __pyx_freelist___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null}, - {Py_tp_new, (void *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null}, - {0, 0}, -}; -static PyType_Spec __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_spec = { - "taos._cinterface.__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", - sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_slots, -}; -#else - -static PyTypeObject __pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null = { - PyVarObject_HEAD_INIT(0, 0) - "taos._cinterface.""__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null", /*tp_name*/ - sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch[8]; -static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch = 0; - -static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch)))) { - o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch]; - memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch)); - (void) PyObject_INIT(o, t); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - #endif - return o; -} - -static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(PyObject *o) { - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch)))) { - __pyx_freelist___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch}, - {Py_tp_new, (void *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch}, - {0, 0}, -}; -static PyType_Spec __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_spec = { - "taos._cinterface.__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", - sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_slots, -}; -#else - -static PyTypeObject __pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch = { - PyVarObject_HEAD_INIT(0, 0) - "taos._cinterface.""__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch", /*tp_name*/ - sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_CONVERT_FUNC, __pyx_k_CONVERT_FUNC, sizeof(__pyx_k_CONVERT_FUNC), 0, 0, 1, 1}, - {&__pyx_n_s_ConnectionError, __pyx_k_ConnectionError, sizeof(__pyx_k_ConnectionError), 0, 0, 1, 1}, - {&__pyx_n_s_DatabaseError, __pyx_k_DatabaseError, sizeof(__pyx_k_DatabaseError), 0, 0, 1, 1}, - {&__pyx_n_s_InternalError, __pyx_k_InternalError, sizeof(__pyx_k_InternalError), 0, 0, 1, 1}, - {&__pyx_n_s_OperationalError, __pyx_k_OperationalError, sizeof(__pyx_k_OperationalError), 0, 0, 1, 1}, - {&__pyx_n_s_ProgrammingError, __pyx_k_ProgrammingError, sizeof(__pyx_k_ProgrammingError), 0, 0, 1, 1}, - {&__pyx_n_s_Pyx_CFunc_a4beef__list__lParen, __pyx_k_Pyx_CFunc_a4beef__list__lParen, sizeof(__pyx_k_Pyx_CFunc_a4beef__list__lParen), 0, 0, 1, 1}, - {&__pyx_n_s_Pyx_CFunc_list__lParensize_t, __pyx_k_Pyx_CFunc_list__lParensize_t, sizeof(__pyx_k_Pyx_CFunc_list__lParensize_t), 0, 0, 1, 1}, - {&__pyx_n_s_SIZED_TYPE, __pyx_k_SIZED_TYPE, sizeof(__pyx_k_SIZED_TYPE), 0, 0, 1, 1}, - {&__pyx_n_s_StatementError, __pyx_k_StatementError, sizeof(__pyx_k_StatementError), 0, 0, 1, 1}, - {&__pyx_n_s_UNSIZED_TYPE, __pyx_k_UNSIZED_TYPE, sizeof(__pyx_k_UNSIZED_TYPE), 0, 0, 1, 1}, - {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, - {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, - {&__pyx_n_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_cfunc_to_py, __pyx_k_cfunc_to_py, sizeof(__pyx_k_cfunc_to_py), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, - {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, - {&__pyx_n_s_dt_epoch, __pyx_k_dt_epoch, sizeof(__pyx_k_dt_epoch), 0, 0, 1, 1}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_fetch_all, __pyx_k_fetch_all, sizeof(__pyx_k_fetch_all), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_is_null, __pyx_k_is_null, sizeof(__pyx_k_is_null), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, - {&__pyx_n_s_num_of_rows, __pyx_k_num_of_rows, sizeof(__pyx_k_num_of_rows), 0, 0, 1, 1}, - {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1}, - {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, - {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, - {&__pyx_n_s_taos__cinterface, __pyx_k_taos__cinterface, sizeof(__pyx_k_taos__cinterface), 0, 0, 1, 1}, - {&__pyx_kp_s_taos__cinterface_pyx, __pyx_k_taos__cinterface_pyx, sizeof(__pyx_k_taos__cinterface_pyx), 0, 0, 1, 0}, - {&__pyx_n_s_taos_error, __pyx_k_taos_error, sizeof(__pyx_k_taos_error), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_wrap, __pyx_k_wrap, sizeof(__pyx_k_wrap), 0, 0, 1, 1}, - {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 14, __pyx_L1_error) - __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 118, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 118, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "cfunc.to_py":67 - * @cname("__Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null") - * cdef object __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(list (*f)(size_t, int, list) ): - * def wrap(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * """wrap(ptr: 'size_t', num_of_rows: 'int', is_null: list) -> list""" - * return f(ptr, num_of_rows, is_null) - */ - __pyx_tuple_ = PyTuple_Pack(3, __pyx_n_s_ptr, __pyx_n_s_num_of_rows, __pyx_n_s_is_null); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 67, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 67, __pyx_L1_error) - __pyx_tuple__3 = PyTuple_Pack(5, __pyx_n_s_ptr, __pyx_n_s_num_of_rows, __pyx_n_s_is_null, __pyx_n_s_precision, __pyx_n_s_dt_epoch); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 67, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 67, __pyx_L1_error) - - /* "taos/_cinterface.pyx":98 - * return blocks, abs(num_of_rows) - * - * cpdef fetch_all(size_t ptr, dt_epoch): # <<<<<<<<<<<<<< - * res = ptr - * fields = taos_fetch_fields(res) - */ - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_ptr, __pyx_n_s_dt_epoch); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__cinterface_pyx, __pyx_n_s_fetch_all, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - if (__Pyx_ExportFunction("taos_get_column_data_is_null", (void (*)(void))__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null, "PyObject *(TAOS_RES *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("taos_fetch_block_v3", (void (*)(void))__pyx_f_4taos_11_cinterface_taos_fetch_block_v3, "PyObject *(TAOS_RES *, TAOS_FIELD *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_type_init_code(void) { - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_spec, NULL); if (unlikely(!__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null)) __PYX_ERR(1, 66, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null_spec, __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null) < 0) __PYX_ERR(1, 66, __pyx_L1_error) - #else - __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null = &__pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null) < 0) __PYX_ERR(1, 66, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null->tp_dictoffset && __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype___pyx_scope_struct____Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - } - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_spec, NULL); if (unlikely(!__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch)) __PYX_ERR(1, 66, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch_spec, __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch) < 0) __PYX_ERR(1, 66, __pyx_L1_error) - #else - __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch = &__pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch) < 0) __PYX_ERR(1, 66, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch->tp_dictoffset && __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype___pyx_scope_struct____Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - } - #endif - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_type_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_import_code(void) { - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __pyx_t_1 = PyImport_ImportModule("taos._parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_string", (void (**)(void))&__pyx_f_4taos_7_parser__parse_string, "PyObject *(size_t, int, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_bool", (void (**)(void))&__pyx_f_4taos_7_parser__parse_bool, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_int8_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_int8_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_int16_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_int16_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_int64_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_int64_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_uint8_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_uint8_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_uint16_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_uint16_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_uint64_t", (void (**)(void))&__pyx_f_4taos_7_parser__parse_uint64_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_int", (void (**)(void))&__pyx_f_4taos_7_parser__parse_int, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_uint", (void (**)(void))&__pyx_f_4taos_7_parser__parse_uint, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_float", (void (**)(void))&__pyx_f_4taos_7_parser__parse_float, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_double", (void (**)(void))&__pyx_f_4taos_7_parser__parse_double, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_timestamp", (void (**)(void))&__pyx_f_4taos_7_parser__parse_timestamp, "PyObject *(size_t, int, PyObject *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; -} - - -#if PY_MAJOR_VERSION >= 3 -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec__cinterface(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec__cinterface}, - {0, NULL} -}; -#endif - -#ifdef __cplusplus -namespace { - struct PyModuleDef __pyx_moduledef = - #else - static struct PyModuleDef __pyx_moduledef = - #endif - { - PyModuleDef_HEAD_INIT, - "_cinterface", - 0, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ - #else - -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - #if CYTHON_USE_MODULE_STATE - __pyx_m_traverse, /* m_traverse */ - __pyx_m_clear, /* m_clear */ - NULL /* m_free */ - #else - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ - #endif - }; - #ifdef __cplusplus -} /* anonymous namespace */ -#endif -#endif - -#ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif -#endif - - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC init_cinterface(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC init_cinterface(void) -#else -__Pyx_PyMODINIT_FUNC PyInit__cinterface(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit__cinterface(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 - static PY_INT64_T main_interpreter_id = -1; - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; - } - return 0; -} -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) -#endif -{ - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else - result = PyDict_SetItemString(moddict, to_name, value); -#endif - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; - } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - CYTHON_UNUSED_VAR(def); - if (__Pyx_check_single_interpreter()) - return NULL; - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; -#endif - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} - - -static CYTHON_SMALL_CODE int __pyx_pymod_exec__cinterface(PyObject *__pyx_pyinit_module) -#endif -#endif -{ - int stringtab_initialized = 0; - #if CYTHON_USE_MODULE_STATE - int pystate_addmodule_run = 0; - #endif - __Pyx_TraceDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module '_cinterface' has already been imported. Re-initialisation is not supported."); - return -1; - } - #elif PY_MAJOR_VERSION >= 3 - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); - #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("_cinterface", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE - __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to _cinterface pseudovariable */ - if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - pystate_addmodule_run = 1; - } - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #endif - CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__cinterface(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_taos___cinterface) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "taos._cinterface")) { - if (unlikely((PyDict_SetItemString(modules, "taos._cinterface", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__cinterface(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); - - /* "taos/_cinterface.pyx":4 - * - * import cython - * import datetime as dt # <<<<<<<<<<<<<< - * import pytz - * from collections import namedtuple - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_cinterface.pyx":5 - * import cython - * import datetime as dt - * import pytz # <<<<<<<<<<<<<< - * from collections import namedtuple - * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pytz, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_cinterface.pyx":6 - * import datetime as dt - * import pytz - * from collections import namedtuple # <<<<<<<<<<<<<< - * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError - * from taos._parser cimport (_parse_bool, _parse_int8_t, _parse_int16_t, _parse_int, _parse_int64_t, _parse_float, _parse_double, _parse_timestamp, - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_namedtuple); - __Pyx_GIVEREF(__pyx_n_s_namedtuple); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_cinterface.pyx":7 - * import pytz - * from collections import namedtuple - * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError # <<<<<<<<<<<<<< - * from taos._parser cimport (_parse_bool, _parse_int8_t, _parse_int16_t, _parse_int, _parse_int64_t, _parse_float, _parse_double, _parse_timestamp, - * _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string) - */ - __pyx_t_3 = PyList_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_ProgrammingError); - __Pyx_GIVEREF(__pyx_n_s_ProgrammingError); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ProgrammingError); - __Pyx_INCREF(__pyx_n_s_OperationalError); - __Pyx_GIVEREF(__pyx_n_s_OperationalError); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_OperationalError); - __Pyx_INCREF(__pyx_n_s_ConnectionError); - __Pyx_GIVEREF(__pyx_n_s_ConnectionError); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ConnectionError); - __Pyx_INCREF(__pyx_n_s_DatabaseError); - __Pyx_GIVEREF(__pyx_n_s_DatabaseError); - PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_DatabaseError); - __Pyx_INCREF(__pyx_n_s_StatementError); - __Pyx_GIVEREF(__pyx_n_s_StatementError); - PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_StatementError); - __Pyx_INCREF(__pyx_n_s_InternalError); - __Pyx_GIVEREF(__pyx_n_s_InternalError); - PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_InternalError); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_taos_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProgrammingError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OperationalError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConnectionError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DatabaseError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StatementError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_StatementError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InternalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InternalError, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_cinterface.pyx":23 - * # --------------------------------------------- parser ---------------------------------------------------------------^ - * SIZED_TYPE = { - * TSDB_DATA_TYPE_BOOL, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_TINYINT, - * TSDB_DATA_TYPE_SMALLINT, - */ - __pyx_t_2 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BOOL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "taos/_cinterface.pyx":24 - * SIZED_TYPE = { - * TSDB_DATA_TYPE_BOOL, - * TSDB_DATA_TYPE_TINYINT, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_SMALLINT, - * TSDB_DATA_TYPE_INT, - */ - __pyx_t_3 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_TINYINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "taos/_cinterface.pyx":25 - * TSDB_DATA_TYPE_BOOL, - * TSDB_DATA_TYPE_TINYINT, - * TSDB_DATA_TYPE_SMALLINT, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_INT, - * TSDB_DATA_TYPE_BIGINT, - */ - __pyx_t_4 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_SMALLINT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "taos/_cinterface.pyx":26 - * TSDB_DATA_TYPE_TINYINT, - * TSDB_DATA_TYPE_SMALLINT, - * TSDB_DATA_TYPE_INT, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_BIGINT, - * TSDB_DATA_TYPE_FLOAT, - */ - __pyx_t_5 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_INT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - - /* "taos/_cinterface.pyx":27 - * TSDB_DATA_TYPE_SMALLINT, - * TSDB_DATA_TYPE_INT, - * TSDB_DATA_TYPE_BIGINT, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_FLOAT, - * TSDB_DATA_TYPE_DOUBLE, - */ - __pyx_t_6 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BIGINT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - - /* "taos/_cinterface.pyx":28 - * TSDB_DATA_TYPE_INT, - * TSDB_DATA_TYPE_BIGINT, - * TSDB_DATA_TYPE_FLOAT, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_DOUBLE, - * TSDB_DATA_TYPE_VARCHAR, - */ - __pyx_t_7 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_FLOAT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - - /* "taos/_cinterface.pyx":29 - * TSDB_DATA_TYPE_BIGINT, - * TSDB_DATA_TYPE_FLOAT, - * TSDB_DATA_TYPE_DOUBLE, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_VARCHAR, - * TSDB_DATA_TYPE_UTINYINT, - */ - __pyx_t_8 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - - /* "taos/_cinterface.pyx":30 - * TSDB_DATA_TYPE_FLOAT, - * TSDB_DATA_TYPE_DOUBLE, - * TSDB_DATA_TYPE_VARCHAR, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_UTINYINT, - * TSDB_DATA_TYPE_USMALLINT, - */ - __pyx_t_9 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARCHAR); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - - /* "taos/_cinterface.pyx":31 - * TSDB_DATA_TYPE_DOUBLE, - * TSDB_DATA_TYPE_VARCHAR, - * TSDB_DATA_TYPE_UTINYINT, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_USMALLINT, - * TSDB_DATA_TYPE_UINT, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UTINYINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - - /* "taos/_cinterface.pyx":32 - * TSDB_DATA_TYPE_VARCHAR, - * TSDB_DATA_TYPE_UTINYINT, - * TSDB_DATA_TYPE_USMALLINT, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_UINT, - * TSDB_DATA_TYPE_UBIGINT, - */ - __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_USMALLINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 32, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "taos/_cinterface.pyx":33 - * TSDB_DATA_TYPE_UTINYINT, - * TSDB_DATA_TYPE_USMALLINT, - * TSDB_DATA_TYPE_UINT, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_UBIGINT, - * } - */ - __pyx_t_12 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UINT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - - /* "taos/_cinterface.pyx":34 - * TSDB_DATA_TYPE_USMALLINT, - * TSDB_DATA_TYPE_UINT, - * TSDB_DATA_TYPE_UBIGINT, # <<<<<<<<<<<<<< - * } - * - */ - __pyx_t_13 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UBIGINT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PySet_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - if (PySet_Add(__pyx_t_14, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_4) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_6) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_7) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_8) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_9) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_10) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_11) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_12) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_14, __pyx_t_13) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIZED_TYPE, __pyx_t_14) < 0) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - - /* "taos/_cinterface.pyx":38 - * - * UNSIZED_TYPE = { - * TSDB_DATA_TYPE_VARCHAR, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_NCHAR, - * TSDB_DATA_TYPE_JSON, - */ - __pyx_t_14 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARCHAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - - /* "taos/_cinterface.pyx":39 - * UNSIZED_TYPE = { - * TSDB_DATA_TYPE_VARCHAR, - * TSDB_DATA_TYPE_NCHAR, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_JSON, - * TSDB_DATA_TYPE_VARBINARY, - */ - __pyx_t_13 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_NCHAR); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - - /* "taos/_cinterface.pyx":40 - * TSDB_DATA_TYPE_VARCHAR, - * TSDB_DATA_TYPE_NCHAR, - * TSDB_DATA_TYPE_JSON, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_VARBINARY, - * TSDB_DATA_TYPE_BINARY, - */ - __pyx_t_12 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_JSON); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - - /* "taos/_cinterface.pyx":41 - * TSDB_DATA_TYPE_NCHAR, - * TSDB_DATA_TYPE_JSON, - * TSDB_DATA_TYPE_VARBINARY, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_BINARY, - * } - */ - __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARBINARY); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - - /* "taos/_cinterface.pyx":42 - * TSDB_DATA_TYPE_JSON, - * TSDB_DATA_TYPE_VARBINARY, - * TSDB_DATA_TYPE_BINARY, # <<<<<<<<<<<<<< - * } - * - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PySet_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PySet_Add(__pyx_t_9, __pyx_t_14) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (PySet_Add(__pyx_t_9, __pyx_t_13) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PySet_Add(__pyx_t_9, __pyx_t_12) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_9, __pyx_t_11) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_9, __pyx_t_10) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNSIZED_TYPE, __pyx_t_9) < 0) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "taos/_cinterface.pyx":46 - * - * CONVERT_FUNC = { - * TSDB_DATA_TYPE_BOOL: _parse_bool, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_TINYINT: _parse_int8_t, - * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, - */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(21); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BOOL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_bool); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "taos/_cinterface.pyx":47 - * CONVERT_FUNC = { - * TSDB_DATA_TYPE_BOOL: _parse_bool, - * TSDB_DATA_TYPE_TINYINT: _parse_int8_t, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, - * TSDB_DATA_TYPE_INT: _parse_int, - */ - __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_TINYINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_int8_t); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":48 - * TSDB_DATA_TYPE_BOOL: _parse_bool, - * TSDB_DATA_TYPE_TINYINT: _parse_int8_t, - * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_INT: _parse_int, - * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_SMALLINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_int16_t); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "taos/_cinterface.pyx":49 - * TSDB_DATA_TYPE_TINYINT: _parse_int8_t, - * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, - * TSDB_DATA_TYPE_INT: _parse_int, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, - * TSDB_DATA_TYPE_FLOAT: _parse_float, - */ - __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_INT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":50 - * TSDB_DATA_TYPE_SMALLINT: _parse_int16_t, - * TSDB_DATA_TYPE_INT: _parse_int, - * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_FLOAT: _parse_float, - * TSDB_DATA_TYPE_DOUBLE: _parse_double, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BIGINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_int64_t); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "taos/_cinterface.pyx":51 - * TSDB_DATA_TYPE_INT: _parse_int, - * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, - * TSDB_DATA_TYPE_FLOAT: _parse_float, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_DOUBLE: _parse_double, - * TSDB_DATA_TYPE_VARCHAR: None, - */ - __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_FLOAT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_float); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":52 - * TSDB_DATA_TYPE_BIGINT: _parse_int64_t, - * TSDB_DATA_TYPE_FLOAT: _parse_float, - * TSDB_DATA_TYPE_DOUBLE: _parse_double, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_VARCHAR: None, - * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_DOUBLE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_double); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "taos/_cinterface.pyx":53 - * TSDB_DATA_TYPE_FLOAT: _parse_float, - * TSDB_DATA_TYPE_DOUBLE: _parse_double, - * TSDB_DATA_TYPE_VARCHAR: None, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, - * TSDB_DATA_TYPE_NCHAR: None, - */ - __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARCHAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "taos/_cinterface.pyx":54 - * TSDB_DATA_TYPE_DOUBLE: _parse_double, - * TSDB_DATA_TYPE_VARCHAR: None, - * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_NCHAR: None, - * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, - */ - __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_TIMESTAMP); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_CFunc_a4beef__list__lParensize_t__comma_int__comma_list__comma_int__comma_object__rParen__etc_to_py_3ptr_11num_of_rows_7is_null_9precision_8dt_epoch(__pyx_f_4taos_7_parser__parse_timestamp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":55 - * TSDB_DATA_TYPE_VARCHAR: None, - * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, - * TSDB_DATA_TYPE_NCHAR: None, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, - * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_NCHAR); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":56 - * TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, - * TSDB_DATA_TYPE_NCHAR: None, - * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, - * TSDB_DATA_TYPE_UINT: _parse_uint, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UTINYINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_uint8_t); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "taos/_cinterface.pyx":57 - * TSDB_DATA_TYPE_NCHAR: None, - * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, - * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_UINT: _parse_uint, - * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, - */ - __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_USMALLINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_uint16_t); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":58 - * TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, - * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, - * TSDB_DATA_TYPE_UINT: _parse_uint, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, - * TSDB_DATA_TYPE_JSON: None, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UINT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_uint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - - /* "taos/_cinterface.pyx":59 - * TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, - * TSDB_DATA_TYPE_UINT: _parse_uint, - * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_JSON: None, - * TSDB_DATA_TYPE_VARBINARY: None, - */ - __pyx_t_11 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_UBIGINT); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_CFunc_list__lParensize_t__comma_int__comma_list__rParen_to_py_3ptr_11num_of_rows_7is_null(__pyx_f_4taos_7_parser__parse_uint64_t); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_11, __pyx_t_10) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":60 - * TSDB_DATA_TYPE_UINT: _parse_uint, - * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, - * TSDB_DATA_TYPE_JSON: None, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_VARBINARY: None, - * TSDB_DATA_TYPE_DECIMAL: None, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_JSON); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":61 - * TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, - * TSDB_DATA_TYPE_JSON: None, - * TSDB_DATA_TYPE_VARBINARY: None, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_DECIMAL: None, - * TSDB_DATA_TYPE_BLOB: None, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_VARBINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":62 - * TSDB_DATA_TYPE_JSON: None, - * TSDB_DATA_TYPE_VARBINARY: None, - * TSDB_DATA_TYPE_DECIMAL: None, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_BLOB: None, - * TSDB_DATA_TYPE_MEDIUMBLOB: None, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_DECIMAL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":63 - * TSDB_DATA_TYPE_VARBINARY: None, - * TSDB_DATA_TYPE_DECIMAL: None, - * TSDB_DATA_TYPE_BLOB: None, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_MEDIUMBLOB: None, - * TSDB_DATA_TYPE_BINARY: None, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BLOB); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":64 - * TSDB_DATA_TYPE_DECIMAL: None, - * TSDB_DATA_TYPE_BLOB: None, - * TSDB_DATA_TYPE_MEDIUMBLOB: None, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_BINARY: None, - * TSDB_DATA_TYPE_GEOMETRY: None, - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_MEDIUMBLOB); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":65 - * TSDB_DATA_TYPE_BLOB: None, - * TSDB_DATA_TYPE_MEDIUMBLOB: None, - * TSDB_DATA_TYPE_BINARY: None, # <<<<<<<<<<<<<< - * TSDB_DATA_TYPE_GEOMETRY: None, - * } - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_BINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 65, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "taos/_cinterface.pyx":66 - * TSDB_DATA_TYPE_MEDIUMBLOB: None, - * TSDB_DATA_TYPE_BINARY: None, - * TSDB_DATA_TYPE_GEOMETRY: None, # <<<<<<<<<<<<<< - * } - * - */ - __pyx_t_10 = __Pyx_PyInt_From_int(TSDB_DATA_TYPE_GEOMETRY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_9, __pyx_t_10, Py_None) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONVERT_FUNC, __pyx_t_9) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "taos/_cinterface.pyx":98 - * return blocks, abs(num_of_rows) - * - * cpdef fetch_all(size_t ptr, dt_epoch): # <<<<<<<<<<<<<< - * res = ptr - * fields = taos_fetch_fields(res) - */ - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_11_cinterface_1fetch_all, 0, __pyx_n_s_fetch_all, NULL, __pyx_n_s_taos__cinterface, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_fetch_all, __pyx_t_9) < 0) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "taos/_cinterface.pyx":1 - * # cython: profile=True # <<<<<<<<<<<<<< - * - * import cython - */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_9) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_TraceReturn(Py_None, 0); - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_XDECREF(__pyx_t_14); - if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init taos._cinterface", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); - } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init taos._cinterface"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; - #else - return; - #endif -} -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#endif - - - -/* #### Code section: utility_code_def ### */ - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; -#endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); - #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#endif - -/* PyObjectGetAttrStrNoError */ -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } -#endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; - } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); - return res; -} -static CYTHON_INLINE PyObject * -__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return PyList_New(0); - } - res = PyList_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); - return res; -} -#endif - -/* BytesEquals */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result; -#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) - Py_hash_t hash1, hash2; - hash1 = ((PyBytesObject*)s1)->ob_shash; - hash2 = ((PyBytesObject*)s2)->ob_shash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - return (equals == Py_NE); - } -#endif - result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } -#if CYTHON_USE_UNICODE_INTERNALS - { - Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED - hash1 = ((PyASCIIObject*)s1)->hash; - hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - goto return_ne; - } - } -#endif - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - -/* fastcall */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) -{ - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); - for (i = 0; i < n; i++) - { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; - } - for (i = 0; i < n; i++) - { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); - if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error - return kwvalues[i]; - } - } - return NULL; // not found (no exception set) -} -#endif - -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - if (kwds_is_tuple) { - if (pos >= PyTuple_GET_SIZE(kwds)) break; - key = PyTuple_GET_ITEM(kwds, pos); - value = kwvalues[pos]; - pos++; - } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; - } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; - } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - -/* FixUpExtensionType */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - CYTHON_UNUSED_VAR(spec); - CYTHON_UNUSED_VAR(type); -#else - const PyType_Slot *slot = spec->slots; - while (slot && slot->slot && slot->slot != Py_tp_members) - slot++; - if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) - const -#endif - PyMemberDef *memb = (PyMemberDef*) slot->pfunc; - while (memb && memb->name) { - if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 - if (strcmp(memb->name, "__weaklistoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_weaklistoffset = memb->offset; - changed = 1; - } - else if (strcmp(memb->name, "__dictoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_dictoffset = memb->offset; - changed = 1; - } -#if CYTHON_METH_FASTCALL - else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 - type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif - changed = 1; - } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON - else if (strcmp(memb->name, "__module__") == 0) { - PyObject *descr; - assert(memb->type == T_OBJECT); - assert(memb->flags == 0 || memb->flags == READONLY); - descr = PyDescr_NewMember(type, memb); - if (unlikely(!descr)) - return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); - return -1; - } - Py_DECREF(descr); - changed = 1; - } -#endif - } - memb++; - } - if (changed) - PyType_Modified(type); - } -#endif - return 0; -} -#endif - -/* FetchSharedCythonModule */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); - if (unlikely(!abi_module)) return NULL; - Py_INCREF(abi_module); - return abi_module; -} - -/* FetchCommonType */ -static int __Pyx_VerifyCachedType(PyObject *cached_type, - const char *name, - Py_ssize_t basicsize, - Py_ssize_t expected_basicsize) { - if (!PyType_Check(cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", name); - return -1; - } - if (basicsize != expected_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - name); - return -1; - } - return 0; -} -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; - const char* object_name = strrchr(spec->name, '.'); - object_name = object_name ? object_name+1 : spec->name; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif - if (__Pyx_VerifyCachedType( - cached_type, - object_name, - basicsize, - spec->basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); - if (unlikely(!cached_type)) goto bad; - if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; -done: - Py_DECREF(abi_module); - assert(cached_type == NULL || PyType_Check(cached_type)); - return (PyTypeObject *) cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#endif - -/* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL -static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - PyObject *res = NULL; - PyObject *kwnames; - PyObject **newargs; - PyObject **kwvalues; - Py_ssize_t i, pos; - size_t j; - PyObject *key, *value; - unsigned long keys_are_strings; - Py_ssize_t nkw = PyDict_GET_SIZE(kw); - newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); - if (unlikely(newargs == NULL)) { - PyErr_NoMemory(); - return NULL; - } - for (j = 0; j < nargs; j++) newargs[j] = args[j]; - kwnames = PyTuple_New(nkw); - if (unlikely(kwnames == NULL)) { - PyMem_Free(newargs); - return NULL; - } - kwvalues = newargs + nargs; - pos = i = 0; - keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; - Py_INCREF(key); - Py_INCREF(value); - PyTuple_SET_ITEM(kwnames, i, key); - kwvalues[i] = value; - i++; - } - if (unlikely(!keys_are_strings)) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - goto cleanup; - } - res = vc(func, newargs, nargs, kwnames); -cleanup: - Py_DECREF(kwnames); - for (i = 0; i < nkw; i++) - Py_DECREF(kwvalues[i]); - PyMem_Free(newargs); - return res; -} -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { - return vc(func, args, nargs, NULL); - } - return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); -} -#endif - -/* CythonFunctionShared */ -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { -#if PY_VERSION_HEX < 0x030900B1 - __Pyx_Py_XDECREF_SET( - __Pyx_CyFunction_GetClassObj(f), - ((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#else - __Pyx_Py_XDECREF_SET( - ((PyCMethodObject *) (f))->mm_class, - (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#endif -} -static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) -{ - CYTHON_UNUSED_VAR(closure); - if (unlikely(op->func_doc == NULL)) { - if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 - op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif - if (unlikely(op->func_doc == NULL)) - return NULL; - } else { - Py_INCREF(Py_None); - return Py_None; - } - } - Py_INCREF(op->func_doc); - return op->func_doc; -} -static int -__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (value == NULL) { - value = Py_None; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_doc, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_name == NULL)) { -#if PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#endif - if (unlikely(op->func_name == NULL)) - return NULL; - } - Py_INCREF(op->func_name); - return op->func_name; -} -static int -__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_name, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_qualname); - return op->func_qualname; -} -static int -__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_qualname, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_globals); - return op->func_globals; -} -static PyObject * -__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(op); - CYTHON_UNUSED_VAR(context); - Py_INCREF(Py_None); - return Py_None; -} -static PyObject * -__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) -{ - PyObject* result = (op->func_code) ? op->func_code : Py_None; - CYTHON_UNUSED_VAR(context); - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { - int result = 0; - PyObject *res = op->defaults_getter((PyObject *) op); - if (unlikely(!res)) - return -1; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - op->defaults_tuple = PyTuple_GET_ITEM(res, 0); - Py_INCREF(op->defaults_tuple); - op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); - Py_INCREF(op->defaults_kwdict); - #else - op->defaults_tuple = PySequence_ITEM(res, 0); - if (unlikely(!op->defaults_tuple)) result = -1; - else { - op->defaults_kwdict = PySequence_ITEM(res, 1); - if (unlikely(!op->defaults_kwdict)) result = -1; - } - #endif - Py_DECREF(res); - return result; -} -static int -__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__defaults__ must be set to a tuple object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_tuple; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__kwdefaults__ must be set to a dict object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_kwdict; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value || value == Py_None) { - value = NULL; - } else if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__annotations__ must be set to a dict object"); - return -1; - } - Py_XINCREF(value); - __Pyx_Py_XDECREF_SET(op->func_annotations, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - result = PyDict_New(); - if (unlikely(!result)) return NULL; - op->func_annotations = result; - } - Py_INCREF(result); - return result; -} -static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; - CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 - if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; - fromlist = PyList_New(1); - if (unlikely(!fromlist)) return NULL; - Py_INCREF(marker); - PyList_SET_ITEM(fromlist, 0, marker); - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); - Py_DECREF(fromlist); - if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); - Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); - } -ignore: - PyErr_Clear(); - } -#endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); -} -static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; -static PyMemberDef __pyx_CyFunction_members[] = { - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, -#if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, -#else - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif -#endif -#if PY_VERSION_HEX < 0x030500A0 - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, -#else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, -#endif -#endif - {0, 0, 0, 0, 0} -}; -static PyObject * -__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) -{ - CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 - Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif -} -static PyMethodDef __pyx_CyFunction_methods[] = { - {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, - {0, 0, 0, 0} -}; -#if PY_VERSION_HEX < 0x030500A0 -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) -#else -#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) -#endif -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - PyCFunctionObject *cf = (PyCFunctionObject*) op; - if (unlikely(op == NULL)) - return NULL; - op->flags = flags; - __Pyx_CyFunction_weakreflist(op) = NULL; - cf->m_ml = ml; - cf->m_self = (PyObject *) op; - Py_XINCREF(closure); - op->func_closure = closure; - Py_XINCREF(module); - cf->m_module = module; - op->func_dict = NULL; - op->func_name = NULL; - Py_INCREF(qualname); - op->func_qualname = qualname; - op->func_doc = NULL; -#if PY_VERSION_HEX < 0x030900B1 - op->func_classobj = NULL; -#else - ((PyCMethodObject*)op)->mm_class = NULL; -#endif - op->func_globals = globals; - Py_INCREF(op->func_globals); - Py_XINCREF(code); - op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; - op->defaults = NULL; - op->defaults_tuple = NULL; - op->defaults_kwdict = NULL; - op->defaults_getter = NULL; - op->func_annotations = NULL; - op->func_is_coroutine = NULL; -#if CYTHON_METH_FASTCALL - switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { - case METH_NOARGS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; - break; - case METH_O: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; - break; - case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; - break; - case METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; - break; - case METH_VARARGS | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = NULL; - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - Py_DECREF(op); - return NULL; - } -#endif - return (PyObject *) op; -} -static int -__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) -{ - Py_CLEAR(m->func_closure); - Py_CLEAR(((PyCFunctionObject*)m)->m_module); - Py_CLEAR(m->func_dict); - Py_CLEAR(m->func_name); - Py_CLEAR(m->func_qualname); - Py_CLEAR(m->func_doc); - Py_CLEAR(m->func_globals); - Py_CLEAR(m->func_code); -#if PY_VERSION_HEX < 0x030900B1 - Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); -#else - { - PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; - ((PyCMethodObject *) (m))->mm_class = NULL; - Py_XDECREF(cls); - } -#endif - Py_CLEAR(m->defaults_tuple); - Py_CLEAR(m->defaults_kwdict); - Py_CLEAR(m->func_annotations); - Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } - return 0; -} -static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - if (__Pyx_CyFunction_weakreflist(m) != NULL) - PyObject_ClearWeakRefs((PyObject *) m); - __Pyx_CyFunction_clear(m); - __Pyx_PyHeapTypeObject_GC_Del(m); -} -static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - PyObject_GC_UnTrack(m); - __Pyx__CyFunction_dealloc(m); -} -static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) -{ - Py_VISIT(m->func_closure); - Py_VISIT(((PyCFunctionObject*)m)->m_module); - Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); - Py_VISIT(m->func_doc); - Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); - Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); - Py_VISIT(m->defaults_tuple); - Py_VISIT(m->defaults_kwdict); - Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } - return 0; -} -static PyObject* -__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", - op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif -} -static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = f->m_ml->ml_meth; - Py_ssize_t size; - switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { - case METH_VARARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 0)) - return (*meth)(self, NULL); - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 1)) { - PyObject *result, *arg0; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - arg0 = PyTuple_GET_ITEM(arg, 0); - #else - arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; - #endif - result = (*meth)(self, arg0); - #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(arg0); - #endif - return result; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - return NULL; - } - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); - return NULL; -} -static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); -} -static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { - PyObject *result; - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL - __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); - if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS - return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); -#else - (void) &__Pyx_PyVectorcall_FastCallDict; - return PyVectorcall_Call(func, args, kw); -#endif - } -#endif - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - Py_ssize_t argc; - PyObject *new_args; - PyObject *self; - argc = PyTuple_GET_SIZE(args); - new_args = PyTuple_GetSlice(args, 1, argc); - if (unlikely(!new_args)) - return NULL; - self = PyTuple_GetItem(args, 0); - if (unlikely(!self)) { - Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 - PyErr_Format(PyExc_TypeError, - "unbound method %.200S() needs an argument", - cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif - return NULL; - } - result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); - Py_DECREF(new_args); - } else { - result = __Pyx_CyFunction_Call(func, args, kw); - } - return result; -} -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) -{ - int ret = 0; - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - ret = 1; - } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - return ret; -} -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, NULL); -} -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, args[0]); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; - PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); -} -#endif -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_CyFunctionType_slots[] = { - {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, - {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, - {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, - {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, - {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, - {Py_tp_methods, (void *)__pyx_CyFunction_methods}, - {Py_tp_members, (void *)__pyx_CyFunction_members}, - {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, - {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, - {0, 0}, -}; -static PyType_Spec __pyx_CyFunctionType_spec = { - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#ifdef _Py_TPFLAGS_HAVE_VECTORCALL - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif -}; -#endif -static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { - return -1; - } - return 0; -} -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); - if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -/* CythonFunction */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), - ml, flags, qualname, closure, module, globals, code - ); - if (likely(op)) { - PyObject_GC_Track(op); - } - return op; -} - -/* PyIntCompare */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_UNUSED_VAR(inplace); - if (op1 == op2) { - return 1; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - return (a == b); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - int unequal; - unsigned long uintval; - Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); - const digit* digits = __Pyx_PyLong_Digits(op1); - if (intval == 0) { - return (__Pyx_PyLong_IsZero(op1) == 1); - } else if (intval < 0) { - if (__Pyx_PyLong_IsNonNeg(op1)) - return 0; - intval = -intval; - } else { - if (__Pyx_PyLong_IsNeg(op1)) - return 0; - } - uintval = (unsigned long) intval; -#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 4)) { - unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 3)) { - unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 2)) { - unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 1)) { - unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif - unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); - return (unequal == 0); - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - return ((double)a == (double)b); - } - return __Pyx_PyObject_IsTrueAndDecref( - PyObject_RichCompare(op1, op2, Py_EQ)); -} - -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } -#endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); -} - -/* SetItemInt */ -static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { - int r; - if (unlikely(!j)) return -1; - r = PyObject_SetItem(o, j, v); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, - CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { - PyObject* old = PyList_GET_ITEM(o, n); - Py_INCREF(v); - PyList_SET_ITEM(o, n, v); - Py_DECREF(old); - return 1; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_ass_subscript) { - int r; - PyObject *key = PyInt_FromSsize_t(i); - if (unlikely(!key)) return -1; - r = mm->mp_ass_subscript(o, key, v); - Py_DECREF(key); - return r; - } - if (likely(sm && sm->sq_ass_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return -1; - PyErr_Clear(); - } - } - return sm->sq_ass_item(o, i, v); - } - } -#else -#if CYTHON_COMPILING_IN_PYPY - if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) -#else - if (is_list || PySequence_Check(o)) -#endif - { - return PySequence_SetItem(o, i, v); - } -#endif - return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); -} - -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (unlikely(!j)) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); - if (unlikely(!key)) return NULL; - r = mm->mp_subscript(o, key); - Py_DECREF(key); - return r; - } - if (likely(sm && sm->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return sm->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; -#endif - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectFastCall */ -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]); - } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - Py_DECREF(argstuple); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { -#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) - if (__Pyx_IsCyOrPyCFunction(func)) -#else - if (PyCFunction_Check(func)) -#endif - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - } - else if (nargs == 1 && kwargs == NULL) { - if (PyCFunction_Check(func)) - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, args[0]); - } - } - } -#endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - #if PY_VERSION_HEX >= 0x030700A1 - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif - #if CYTHON_VECTORCALL - vectorcallfunc f = _PyVectorcall_Function(func); - if (f) { - return f(func, args, (size_t)nargs, kwargs); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, kwargs); - } - #endif - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); - } - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); -} - -/* py_abs */ -#if CYTHON_USE_PYLONG_INTERNALS -static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { -#if PY_VERSION_HEX >= 0x030C00A7 - if (likely(__Pyx_PyLong_IsCompact(n))) { - return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n)); - } -#else - if (likely(Py_SIZE(n) == -1)) { - return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]); - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - { - PyObject *copy = _PyLong_Copy((PyLongObject*)n); - if (likely(copy)) { - #if PY_VERSION_HEX >= 0x030C00A7 - ((PyLongObject*)copy)->long_value.lv_tag = ((PyLongObject*)copy)->long_value.lv_tag & ~_PyLong_SIGN_MASK; - #else - __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); - #endif - } - return copy; - } -#else - return PyNumber_Negative(n); -#endif -} -#endif - -/* RaiseTooManyValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -/* RaiseNeedMoreValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -/* IterFinish */ -static CYTHON_INLINE int __Pyx_IterFinish(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); - if (unlikely(exc_type)) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) - return -1; - __Pyx_PyErr_Clear(); - return 0; - } - return 0; -} - -/* UnpackItemEndCheck */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } - return __Pyx_IterFinish(); -} - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* PyObjectCallNoArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { - PyObject *arg = NULL; - return __Pyx_PyObject_FastCall(func, (&arg)+1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectGetMethod */ -static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { - PyObject *attr; -#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP - __Pyx_TypeName type_name; - PyTypeObject *tp = Py_TYPE(obj); - PyObject *descr; - descrgetfunc f = NULL; - PyObject **dictptr, *dict; - int meth_found = 0; - assert (*method == NULL); - if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { - attr = __Pyx_PyObject_GetAttrStr(obj, name); - goto try_unpack; - } - if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { - return 0; - } - descr = _PyType_Lookup(tp, name); - if (likely(descr != NULL)) { - Py_INCREF(descr); -#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR - if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) - #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif -#endif - { - meth_found = 1; - } else { - f = Py_TYPE(descr)->tp_descr_get; - if (f != NULL && PyDescr_IsData(descr)) { - attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); - Py_DECREF(descr); - goto try_unpack; - } - } - } - dictptr = _PyObject_GetDictPtr(obj); - if (dictptr != NULL && (dict = *dictptr) != NULL) { - Py_INCREF(dict); - attr = __Pyx_PyDict_GetItemStr(dict, name); - if (attr != NULL) { - Py_INCREF(attr); - Py_DECREF(dict); - Py_XDECREF(descr); - goto try_unpack; - } - Py_DECREF(dict); - } - if (meth_found) { - *method = descr; - return 1; - } - if (f != NULL) { - attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); - Py_DECREF(descr); - goto try_unpack; - } - if (likely(descr != NULL)) { - *method = descr; - return 0; - } - type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return 0; -#else - attr = __Pyx_PyObject_GetAttrStr(obj, name); - goto try_unpack; -#endif -try_unpack: -#if CYTHON_UNPACK_METHODS - if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { - PyObject *function = PyMethod_GET_FUNCTION(attr); - Py_INCREF(function); - Py_DECREF(attr); - *method = function; - return 1; - } -#endif - *method = attr; - return 0; -} - -/* PyObjectCallMethod0 */ -static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { - PyObject *method = NULL, *result = NULL; - int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); - if (likely(is_method)) { - result = __Pyx_PyObject_CallOneArg(method, obj); - Py_DECREF(method); - return result; - } - if (unlikely(!method)) goto bad; - result = __Pyx_PyObject_CallNoArg(method); - Py_DECREF(method); -bad: - return result; -} - -/* ValidateBasesTuple */ -#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS -static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { - Py_ssize_t i, n = PyTuple_GET_SIZE(bases); - for (i = 1; i < n; i++) - { - PyObject *b0 = PyTuple_GET_ITEM(bases, i); - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); - return -1; - } -#endif - b = (PyTypeObject*) b0; - if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) - { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); - __Pyx_DECREF_TypeName(b_name); - return -1; - } - if (dictoffset == 0 && b->tp_dictoffset) - { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); - return -1; - } - } - return 0; -} -#endif - -/* PyType_Ready */ -static int __Pyx_PyType_Ready(PyTypeObject *t) { -#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) - (void)__Pyx_PyObject_CallMethod0; -#if CYTHON_USE_TYPE_SPECS - (void)__Pyx_validate_bases_tuple; -#endif - return PyType_Ready(t); -#else - int r; - PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); - if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) - return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) - { - int gc_was_enabled; - #if PY_VERSION_HEX >= 0x030A00b1 - gc_was_enabled = PyGC_Disable(); - (void)__Pyx_PyObject_CallMethod0; - #else - PyObject *ret, *py_status; - PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); - #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); - if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); - if (unlikely(!py_status)) { - Py_DECREF(gc); - return -1; - } - gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); - Py_DECREF(py_status); - if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); - if (unlikely(!ret)) { - Py_DECREF(gc); - return -1; - } - Py_DECREF(ret); - } else if (unlikely(gc_was_enabled == -1)) { - Py_DECREF(gc); - return -1; - } - #endif - t->tp_flags |= Py_TPFLAGS_HEAPTYPE; -#if PY_VERSION_HEX >= 0x030A0000 - t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; -#endif -#else - (void)__Pyx_PyObject_CallMethod0; -#endif - r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) - t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; - #if PY_VERSION_HEX >= 0x030A00b1 - if (gc_was_enabled) - PyGC_Enable(); - #else - if (gc_was_enabled) { - PyObject *tp, *v, *tb; - PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); - if (likely(ret || r == -1)) { - Py_XDECREF(ret); - PyErr_Restore(tp, v, tb); - } else { - Py_XDECREF(tp); - Py_XDECREF(v); - Py_XDECREF(tb); - r = -1; - } - } - Py_DECREF(gc); - #endif - } -#endif - return r; -#endif -} - -/* PyObject_GenericGetAttrNoDict */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; - } - } - return descr; -} -#endif - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, 1); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - #endif - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, level); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif - #endif - } - } -bad: - Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif - return module; -} - -/* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 - PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif - "No module named '%U'", partial_name); -#endif -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; - nparts = PyTuple_GET_SIZE(parts_tuple); - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = PySequence_ITEM(parts_tuple, i); -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } - return module; -} -#endif -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__6; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} - -/* ImportFrom */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - const char* module_name_str = 0; - PyObject* module_name = 0; - PyObject* module_dot = 0; - PyObject* full_name = 0; - PyErr_Clear(); - module_name_str = PyModule_GetName(module); - if (unlikely(!module_name_str)) { goto modbad; } - module_name = PyUnicode_FromString(module_name_str); - if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__7); - if (unlikely(!module_dot)) { goto modbad; } - full_name = PyUnicode_Concat(module_dot, name); - if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - { - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - goto modbad; - value = PyObject_GetItem(modules, full_name); - } - #else - value = PyImport_GetModule(full_name); - #endif - modbad: - Py_XDECREF(full_name); - Py_XDECREF(module_dot); - Py_XDECREF(module_name); - } - if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; - PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif - CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { - return c_line; - } - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); - if (likely(cython_runtime_dict)) { - __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { - c_line = 0; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - return c_line; -} -#endif - -/* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} -#endif - -/* AddTraceback */ -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); - } - _PyTraceback_Add(funcname, filename, py_line); -} -#else -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = NULL; - PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - funcname = PyUnicode_AsUTF8(py_funcname); - if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif - } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else - py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline - return py_code; -bad: - Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject *ptype, *pvalue, *ptraceback; - if (c_line) { - c_line = __Pyx_CLineForTraceback(tstate, c_line); - } - py_code = __pyx_find_code_object(c_line ? -c_line : py_line); - if (!py_code) { - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) { - /* If the code object creation fails, then we should clear the - fetched exception references and propagate the new exception */ - Py_XDECREF(ptype); - Py_XDECREF(pvalue); - Py_XDECREF(ptraceback); - goto bad; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); - } - py_frame = PyFrame_New( - tstate, /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} -#endif - -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* CIntFromPy */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(size_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (size_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { - return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { - return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { - return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (size_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(size_t) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { - return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { - return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { - return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { - return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { - return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { - return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(size_t) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - size_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (size_t) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (size_t) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (size_t) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (size_t) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (size_t) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((size_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((size_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (size_t) -1; - } - } else { - size_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (size_t) -1; - val = __Pyx_PyInt_As_size_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to size_t"); - return (size_t) -1; -} - -/* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int8_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int8_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int8_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int8_t), - little, !is_unsigned); - } -} - -/* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API -static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) -{ - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__9)); - } - return name; -} -#endif - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (long) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (long) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (long) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* FastTypeChecks */ -#if CYTHON_COMPILING_IN_CPYTHON -static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { - while (a) { - a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); - if (a == b) - return 1; - } - return b == &PyBaseObject_Type; -} -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (a == b) return 1; - mro = a->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(a, b); -} -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (cls == a || cls == b) return 1; - mro = cls->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - PyObject *base = PyTuple_GET_ITEM(mro, i); - if (base == (PyObject *)a || base == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else -static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { - if (exc_type1) { - return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); - } else { - return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); - } -} -#endif -static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - assert(PyExceptionClass_Check(exc_type)); - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i '9'); - break; - } - if (rt_from_call[i] != ctversion[i]) { - same = 0; - break; - } - } - if (!same) { - char rtversion[5] = {'\0'}; - char message[200]; - for (i=0; i<4; ++i) { - if (rt_from_call[i] == '.') { - if (found_dot) break; - found_dot = 1; - } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { - break; - } - rtversion[i] = rt_from_call[i]; - } - PyOS_snprintf(message, sizeof(message), - "compile time version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* FunctionExport */ -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); - if (!d) { - PyErr_Clear(); - d = PyDict_New(); - if (!d) - goto bad; - Py_INCREF(d); - if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) - goto bad; - } - tmp.fp = f; - cobj = PyCapsule_New(tmp.p, sig, 0); - if (!cobj) - goto bad; - if (PyDict_SetItemString(d, name, cobj) < 0) - goto bad; - Py_DECREF(cobj); - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(cobj); - Py_XDECREF(d); - return -1; -} - -/* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction_3_0_0 -#define __PYX_HAVE_RT_ImportFunction_3_0_0 -static int __Pyx_ImportFunction_3_0_0(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); - if (!d) - goto bad; - cobj = PyDict_GetItemString(d, funcname); - if (!cobj) { - PyErr_Format(PyExc_ImportError, - "%.200s does not export expected C function %.200s", - PyModule_GetName(module), funcname); - goto bad; - } - if (!PyCapsule_IsValid(cobj, sig)) { - PyErr_Format(PyExc_TypeError, - "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", - PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); - goto bad; - } - tmp.p = PyCapsule_GetPointer(cobj, sig); - *f = tmp.fp; - if (!(*f)) - goto bad; - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(d); - return -1; -} -#endif - -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); - } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); - } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); - } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} -#endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - if (!*t->p) - return -1; - if (PyObject_Hash(*t->p) == -1) - return -1; - #endif - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} -#else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (likely(PyUnicode_IS_ASCII(o))) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -} -#endif -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { - return __Pyx_PyUnicode_AsStringAndSize(o, length); - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { - int retval; - if (unlikely(!x)) return -1; - retval = __Pyx_PyObject_IsTrue(x); - Py_DECREF(x); - return retval; -} -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 - if (PyLong_Check(result)) { - if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, - "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " - "The ability to return an instance of a strict subclass of int is deprecated, " - "and may be removed in a future version of Python.", - result_type_name)) { - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; - } - __Pyx_DECREF_TypeName(result_type_name); - return result; - } -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { -#if CYTHON_USE_TYPE_SLOTS - PyNumberMethods *m; -#endif - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else - if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); -#if CYTHON_USE_TYPE_SLOTS - m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else - if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); - } - #endif -#else - if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); - } -#endif - if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(__Pyx_PyLong_IsCompact(b))) { - return __Pyx_PyLong_CompactValue(b); - } else { - const digit* digits = __Pyx_PyLong_Digits(b); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { - if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { - return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif - } else { - Py_ssize_t ival; - PyObject *x; - x = PyNumber_Index(o); - if (!x) return -1; - ival = PyInt_AsLong(x); - Py_DECREF(x); - return ival; - } -} -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -/* #### Code section: utility_code_pragmas_end ### */ -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - - - -/* #### Code section: end ### */ -#endif /* Py_PYTHON_H */ diff --git a/taos/_objects.c b/taos/_objects.c deleted file mode 100644 index e572ca91..00000000 --- a/taos/_objects.c +++ /dev/null @@ -1,33552 +0,0 @@ -/* Generated by Cython 3.0.0 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [ - "C:\\TDengine\\include\\taos.h" - ], - "include_dirs": [ - "C:\\TDengine\\include" - ], - "libraries": [ - "taos" - ], - "library_dirs": [ - "C:\\TDengine\\driver" - ], - "name": "taos._objects", - "sources": [ - "taos/_objects.pyx" - ] - }, - "module_name": "taos._objects" -} -END: Cython Metadata */ - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif -#endif - -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#define CYTHON_ABI "3_0_0" -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030000F0 -#define CYTHON_FUTURE_DIVISION 1 -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#if defined(GRAALVM_PYTHON) - /* For very preliminary testing purposes. Most variables are set the same as PyPy. - The existence of this section does not imply that anything works or is even tested */ - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PYPY_VERSION) - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #if PY_VERSION_HEX < 0x03090000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(CYTHON_LIMITED_API) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 1 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 1 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #endif - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PY_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #ifndef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 1 - #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 1 - #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 1 - #endif - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #elif !defined(CYTHON_USE_UNICODE_WRITER) - #define CYTHON_USE_UNICODE_WRITER 1 - #endif - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #ifndef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 1 - #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) - #endif - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) - #endif - #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 1 - #endif - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #if PY_VERSION_HEX < 0x030600B1 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) - #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) - #define CYTHON_USE_EXC_INFO_STACK 1 - #endif - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif -#endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) -#endif -#if !defined(CYTHON_VECTORCALL) -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) -#endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif - #undef SHIFT - #undef BASE - #undef MASK - #ifdef SIZEOF_VOID_P - enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; - #endif -#endif -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif -#ifndef __has_cpp_attribute - #define __has_cpp_attribute(x) 0 -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifndef CYTHON_UNUSED - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(maybe_unused) - #define CYTHON_UNUSED [[maybe_unused]] - #endif - #endif - #endif -#endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_UNUSED_VAR -# if defined(__cplusplus) - template void CYTHON_UNUSED_VAR( const T& ) { } -# else -# define CYTHON_UNUSED_VAR(x) (void)(x) -# endif -#endif -#ifndef CYTHON_MAYBE_UNUSED_VAR - #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif -#ifndef CYTHON_FALLTHROUGH - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(fallthrough) - #define CYTHON_FALLTHROUGH [[fallthrough]] - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_cpp_attribute(clang::fallthrough) - #define CYTHON_FALLTHROUGH [[clang::fallthrough]] - #elif __has_cpp_attribute(gnu::fallthrough) - #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] - #endif - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_attribute(fallthrough) - #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) - #else - #define CYTHON_FALLTHROUGH - #endif - #endif - #if defined(__clang__) && defined(__apple_build_version__) - #if __apple_build_version__ < 7000000 - #undef CYTHON_FALLTHROUGH - #define CYTHON_FALLTHROUGH - #endif - #endif -#endif -#ifdef __cplusplus - template - struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; - #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) -#else - #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) -#endif -#if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) -#else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) -#endif -#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) - -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #elif defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type -#if PY_VERSION_HEX >= 0x030B00A1 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; - PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; - const char *fn_cstr=NULL; - const char *name_cstr=NULL; - PyCodeObject *co=NULL, *result=NULL; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - if (!(kwds=PyDict_New())) goto end; - if (!(argcount=PyLong_FromLong(a))) goto end; - if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; - if (!(posonlyargcount=PyLong_FromLong(p))) goto end; - if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; - if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; - if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; - if (!(nlocals=PyLong_FromLong(l))) goto end; - if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; - if (!(stacksize=PyLong_FromLong(s))) goto end; - if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; - if (!(flags=PyLong_FromLong(f))) goto end; - if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; - if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; - if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; - if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; - if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; - if (!(empty = PyTuple_New(0))) goto end; - result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); - end: - Py_XDECREF((PyObject*) co); - Py_XDECREF(kwds); - Py_XDECREF(argcount); - Py_XDECREF(posonlyargcount); - Py_XDECREF(kwonlyargcount); - Py_XDECREF(nlocals); - Py_XDECREF(stacksize); - Py_XDECREF(replace); - Py_XDECREF(empty); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#endif -#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) - #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) -#else - #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) - #define __Pyx_Py_Is(x, y) Py_Is(x, y) -#else - #define __Pyx_Py_Is(x, y) ((x) == (y)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) - #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) -#else - #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) - #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) -#else - #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) - #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) -#else - #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) -#endif -#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) -#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) -#else - #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) -#endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#ifndef Py_TPFLAGS_SEQUENCE - #define Py_TPFLAGS_SEQUENCE 0 -#endif -#ifndef Py_TPFLAGS_MAPPING - #define Py_TPFLAGS_MAPPING 0 -#endif -#ifndef METH_STACKLESS - #define METH_STACKLESS 0 -#endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) - #ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - #endif - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); - typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, - Py_ssize_t nargs, PyObject *kwnames); -#else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords -#endif -#if CYTHON_METH_FASTCALL - #define __Pyx_METH_FASTCALL METH_FASTCALL - #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast - #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords -#else - #define __Pyx_METH_FASTCALL METH_VARARGS - #define __Pyx_PyCFunction_FastCall PyCFunction - #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords -#endif -#if CYTHON_VECTORCALL - #define __pyx_vectorcallfunc vectorcallfunc - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET - #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) -#else - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) -#endif -#if PY_VERSION_HEX < 0x030900B1 - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) - typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); -#else - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) - #define __Pyx_PyCMethod PyCMethod -#endif -#ifndef METH_METHOD - #define METH_METHOD 0x200 -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyThreadState_Current PyThreadState_Get() -#elif !CYTHON_FAST_THREAD_STATE - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#else - #define __Pyx_PyThreadState_Current _PyThreadState_Current -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) -{ - void *result; - result = PyModule_GetState(op); - if (!result) - Py_FatalError("Couldn't find the module state"); - return result; -} -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) -#else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif -#endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) -#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) -#else -#define __Pyx_PyDict_NewPresized(n) PyDict_New() -#endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS -#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { - PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); - if (res == NULL) PyErr_Clear(); - return res; -} -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) -#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#else -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { -#if CYTHON_COMPILING_IN_PYPY - return PyDict_GetItem(dict, name); -#else - PyDictEntry *ep; - PyDictObject *mp = (PyDictObject*) dict; - long hash = ((PyStringObject *) name)->ob_shash; - assert(hash != -1); - ep = (mp->ma_lookup)(mp, name, hash); - if (ep == NULL) { - return NULL; - } - return ep->me_value; -#endif -} -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#endif -#if CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) - #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) -#else - #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) - #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 -#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ - assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ - PyObject_GC_Del(obj);\ - Py_DECREF(type);\ -} -#else -#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) - #define __Pyx_PyUnicode_DATA(u) ((void*)u) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_READY(op) (0) - #else - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) - #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) - #else - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #if !defined(PyUnicode_DecodeUnicodeEscape) - #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) - #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) - #endif - #if !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) - #endif - #if !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) - #endif -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#if CYTHON_COMPILING_IN_CPYTHON - #define __Pyx_PySequence_ListKeepNew(obj)\ - (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) -#else - #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) -#endif -#if PY_VERSION_HEX >= 0x030900A4 - #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) -#else - #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) -#endif -#if CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) -#else - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif -#else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef __Pyx_PyAsyncMethodsStruct - typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; - } __Pyx_PyAsyncMethodsStruct; -#endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } -#define __PYX_ERR(f_index, lineno, Ln_error) \ - { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } - -#ifdef CYTHON_EXTERN_C - #undef __PYX_EXTERN_C - #define __PYX_EXTERN_C CYTHON_EXTERN_C -#elif defined(__PYX_EXTERN_C) - #ifdef _MSC_VER - #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") - #else - #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. - #endif -#else - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__taos___objects -#define __PYX_HAVE_API__taos___objects -/* Early includes */ -#include -#include "taos.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { - return (size_t) i < (size_t) limit; -} -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) - #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif -#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -#define __Pyx_PySequence_Tuple(obj)\ - (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); -#if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_VERSION_HEX >= 0x030C00A7 - #ifndef _PyLong_SIGN_MASK - #define _PyLong_SIGN_MASK 3 - #endif - #ifndef _PyLong_NON_SIZE_BITS - #define _PyLong_NON_SIZE_BITS 3 - #endif - #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) - #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) - #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) - #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) - #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_SignedDigitCount(x)\ - ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) - #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) - #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) - #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) - #else - #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) - #endif - typedef Py_ssize_t __Pyx_compact_pylong; - typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 - #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) - #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) - #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) - #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) - #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) - #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) - #define __Pyx_PyLong_CompactValue(x)\ - ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) - typedef sdigit __Pyx_compact_pylong; - typedef digit __Pyx_compact_upylong; - #endif - #if PY_VERSION_HEX >= 0x030C00A5 - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) - #else - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) - #endif -#endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ -static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } - -#if !CYTHON_USE_MODULE_STATE -static PyObject *__pyx_m = NULL; -#endif -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; -static const char *__pyx_filename; - -/* #### Code section: filename_table ### */ - -static const char *__pyx_f[] = { - "taos\\\\_objects.pyx", - "", -}; -/* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif - -/* NoFastGil.proto */ -#define __Pyx_PyGILState_Ensure PyGILState_Ensure -#define __Pyx_PyGILState_Release PyGILState_Release -#define __Pyx_FastGIL_Remember() -#define __Pyx_FastGIL_Forget() -#define __Pyx_FastGilFuncInit() - -/* #### Code section: numeric_typedefs ### */ -/* #### Code section: complex_type_declarations ### */ -/* #### Code section: type_declarations ### */ - -/*--- Type declarations ---*/ -struct __pyx_obj_4taos_8_objects_TaosConnection; -struct __pyx_obj_4taos_8_objects_TaosField; -struct __pyx_obj_4taos_8_objects_TaosResult; -struct __pyx_obj_4taos_8_objects_TaosCursor; -struct __pyx_obj_4taos_8_objects_TaosTopicAssignment; -struct __pyx_obj_4taos_8_objects_TaosConsumer; -struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter; -struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter; -struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__; - -/* "taos/_objects.pyx":46 - * - * - * cdef class TaosConnection: # <<<<<<<<<<<<<< - * cdef char *_host - * cdef char *_user - */ -struct __pyx_obj_4taos_8_objects_TaosConnection { - PyObject_HEAD - char *_host; - char *_user; - char *_password; - char *_database; - uint16_t _port; - char *_tz; - char *_config; - TAOS *_raw_conn; -}; - - -/* "taos/_objects.pyx":195 - * - * - * cdef class TaosField: # <<<<<<<<<<<<<< - * cdef str _name - * cdef int8_t _type - */ -struct __pyx_obj_4taos_8_objects_TaosField { - PyObject_HEAD - PyObject *_name; - int8_t _type; - int32_t _bytes; -}; - - -/* "taos/_objects.pyx":231 - * - * - * cdef class TaosResult: # <<<<<<<<<<<<<< - * cdef TAOS_RES *_res - * cdef TAOS_FIELD *_fields - */ -struct __pyx_obj_4taos_8_objects_TaosResult { - PyObject_HEAD - TAOS_RES *_res; - TAOS_FIELD *_fields; - int _field_count; - int _precision; - int _row_count; - int _affected_rows; -}; - - -/* "taos/_objects.pyx":413 - * - * - * cdef class TaosCursor: # <<<<<<<<<<<<<< - * cdef list _description - * cdef TaosConnection _connection - */ -struct __pyx_obj_4taos_8_objects_TaosCursor { - PyObject_HEAD - PyObject *_description; - struct __pyx_obj_4taos_8_objects_TaosConnection *_connection; - struct __pyx_obj_4taos_8_objects_TaosResult *_result; -}; - - -/* "taos/_objects.pyx":475 - * - * - * cdef class TaosTopicAssignment: # <<<<<<<<<<<<<< - * cdef int32_t _vg_id - * cdef int64_t _current_offset - */ -struct __pyx_obj_4taos_8_objects_TaosTopicAssignment { - PyObject_HEAD - int32_t _vg_id; - int64_t _current_offset; - int64_t _begin; - int64_t _end; -}; - - -/* "taos/_objects.pyx":504 - * - * - * cdef class TaosConsumer: # <<<<<<<<<<<<<< - * cdef dict _configs - * cdef tmq_conf_t *_tmq_conf - */ -struct __pyx_obj_4taos_8_objects_TaosConsumer { - PyObject_HEAD - PyObject *_configs; - tmq_conf_t *_tmq_conf; - tmq_t *_tmq; -}; - - -/* "taos/_objects.pyx":355 - * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] - * - * def rows_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ -struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter { - PyObject_HEAD - void *__pyx_v_data; - PyObject *__pyx_v_dt_epoch; - TAOS_FIELD __pyx_v_field; - int __pyx_v_i; - PyObject *__pyx_v_is_null; - PyObject *__pyx_v_row; - struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self; - TAOS_ROW __pyx_v_taos_row; -}; - - -/* "taos/_objects.pyx":387 - * yield row - * - * def blocks_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ -struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter { - PyObject_HEAD - PyObject *__pyx_v_block; - PyObject *__pyx_v_num_of_rows; - PyObject *__pyx_8genexpr6__pyx_v_r; - struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self; -}; - - -/* "taos/_objects.pyx":423 - * self._result = None - * - * def __iter__(self): # <<<<<<<<<<<<<< - * for block, num_of_rows in self._result.blocks_iter(): - * for row in block: - */ -struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ { - PyObject_HEAD - PyObject *__pyx_v_block; - PyObject *__pyx_v_num_of_rows; - PyObject *__pyx_v_row; - struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self; - PyObject *__pyx_t_0; - PyObject *__pyx_t_1; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - Py_ssize_t __pyx_t_4; - PyObject *(*__pyx_t_5)(PyObject *); -}; - -/* #### Code section: utility_code_proto ### */ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, Py_ssize_t); - void (*DECREF)(void*, PyObject*, Py_ssize_t); - void (*GOTREF)(void*, PyObject*, Py_ssize_t); - void (*GIVEREF)(void*, PyObject*, Py_ssize_t); - void* (*SetupContext)(const char*, Py_ssize_t, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - } - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContextNogil() - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_Py_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; Py_XDECREF(tmp);\ - } while (0) -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; -#if PY_VERSION_HEX >= 0x030C00A6 -#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) -#else -#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) -#endif -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) -#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 -#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) -#else -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#endif -#else -#define __Pyx_PyErr_Clear() PyErr_Clear() -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* PyObjectGetAttrStrNoError.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* TupleAndListFromArray.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); -static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); -#endif - -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -/* fastcall.proto */ -#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) -#define __Pyx_KwValues_VARARGS(args, nargs) NULL -#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) -#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) -#if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) - #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) - static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); - #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) -#else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS - #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS - #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS - #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS - #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS -#endif -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) -#endif - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* Profile.proto */ -#ifndef CYTHON_PROFILE -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #define CYTHON_PROFILE 0 -#else - #define CYTHON_PROFILE 1 -#endif -#endif -#ifndef CYTHON_TRACE_NOGIL - #define CYTHON_TRACE_NOGIL 0 -#else - #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) - #define CYTHON_TRACE 1 - #endif -#endif -#ifndef CYTHON_TRACE - #define CYTHON_TRACE 0 -#endif -#if CYTHON_TRACE - #undef CYTHON_PROFILE_REUSE_FRAME -#endif -#ifndef CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_PROFILE_REUSE_FRAME 0 -#endif -#if CYTHON_PROFILE || CYTHON_TRACE - #include "compile.h" - #include "frameobject.h" - #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #if CYTHON_PROFILE_REUSE_FRAME - #define CYTHON_FRAME_MODIFIER static - #define CYTHON_FRAME_DEL(frame) - #else - #define CYTHON_FRAME_MODIFIER - #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) - #endif - #define __Pyx_TraceDeclarations\ - static PyCodeObject *__pyx_frame_code = NULL;\ - CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ - int __Pyx_use_tracing = 0; - #define __Pyx_TraceFrameInit(codeobj)\ - if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; -#if PY_VERSION_HEX >= 0x030b00a2 - #if PY_VERSION_HEX >= 0x030C00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - ((!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #endif - #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) - #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) -#elif PY_VERSION_HEX >= 0x030a00b1 - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->cframe->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#else - #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ - (unlikely((tstate)->use_tracing) &&\ - (!(check_tracing) || !(tstate)->tracing) &&\ - (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) - #define __Pyx_EnterTracing(tstate)\ - do { tstate->tracing++; tstate->use_tracing = 0; } while (0) - #define __Pyx_LeaveTracing(tstate)\ - do {\ - tstate->tracing--;\ - tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ - || tstate->c_profilefunc != NULL);\ - } while (0) -#endif - #ifdef WITH_THREAD - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - }\ - PyGILState_Release(state);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #else - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ - { PyThreadState* tstate = PyThreadState_GET();\ - if (__Pyx_IsTracing(tstate, 1, 1)) {\ - __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ - if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ - }\ - } - #endif - #define __Pyx_TraceException()\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 1)) {\ - __Pyx_EnterTracing(tstate);\ - PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ - if (exc_info) {\ - if (CYTHON_TRACE && tstate->c_tracefunc)\ - tstate->c_tracefunc(\ - tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - tstate->c_profilefunc(\ - tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ - Py_DECREF(exc_info);\ - }\ - __Pyx_LeaveTracing(tstate);\ - }\ - } - static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_EnterTracing(tstate); - if (CYTHON_TRACE && tstate->c_tracefunc) - tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); - if (tstate->c_profilefunc) - tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); - CYTHON_FRAME_DEL(frame); - __Pyx_LeaveTracing(tstate); - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } - #ifdef WITH_THREAD - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - PyThreadState *tstate;\ - PyGILState_STATE state = PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - PyGILState_Release(state);\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - }\ - } - #else - #define __Pyx_TraceReturn(result, nogil)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0)) {\ - __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ - }\ - } - #endif - static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); - static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); -#else - #define __Pyx_TraceDeclarations - #define __Pyx_TraceFrameInit(codeobj) - #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; - #define __Pyx_TraceException() - #define __Pyx_TraceReturn(result, nogil) -#endif -#if CYTHON_TRACE - static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { - int ret; - PyObject *type, *value, *traceback; - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - __Pyx_PyFrame_SetLineNumber(frame, lineno); - __Pyx_EnterTracing(tstate); - ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); - __Pyx_LeaveTracing(tstate); - if (likely(!ret)) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - } - return ret; - } - #ifdef WITH_THREAD - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - if (nogil) {\ - if (CYTHON_TRACE_NOGIL) {\ - int ret = 0;\ - PyThreadState *tstate;\ - PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ - tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - }\ - __Pyx_PyGILState_Release(state);\ - if (unlikely(ret)) goto_error;\ - }\ - } else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - }\ - } - #else - #define __Pyx_TraceLine(lineno, nogil, goto_error)\ - if (likely(!__Pyx_use_tracing)); else {\ - PyThreadState* tstate = __Pyx_PyThreadState_Current;\ - if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ - int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ - if (unlikely(ret)) goto_error;\ - }\ - } - #endif -#else - #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; -#endif - -/* PyDictVersioning.proto */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif - -/* GetModuleGlobalName.proto */ -#if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) do {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ - (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ - __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ - PY_UINT64_T __pyx_dict_version;\ - PyObject *__pyx_dict_cached_value;\ - (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); -#else -#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) -#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); -#endif - -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectFastCall.proto */ -#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); - -/* ListCompAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len)) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) -#endif - -/* decode_c_string_utf16.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { - int byteorder = 0; - return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); -} -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { - int byteorder = -1; - return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); -} -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { - int byteorder = 1; - return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); -} - -/* decode_c_bytes.proto */ -static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( - const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, - const char* encoding, const char* errors, - PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); - -/* decode_bytes.proto */ -static CYTHON_INLINE PyObject* __Pyx_decode_bytes( - PyObject* string, Py_ssize_t start, Py_ssize_t stop, - const char* encoding, const char* errors, - PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { - return __Pyx_decode_c_bytes( - PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string), - start, stop, encoding, errors, decode_func); -} - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* IterFinish.proto */ -static CYTHON_INLINE int __Pyx_IterFinish(void); - -/* UnpackItemEndCheck.proto */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* KeywordStringCheck.proto */ -static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); - -/* WriteUnraisableException.proto */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - -/* decode_c_string.proto */ -static CYTHON_INLINE PyObject* __Pyx_decode_c_string( - const char* cstring, Py_ssize_t start, Py_ssize_t stop, - const char* encoding, const char* errors, - PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); - -/* ArgTypeTest.proto */ -#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ - ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ - __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyObjectCallNoArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); - -/* PyObjectGetMethod.proto */ -static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); - -/* PyObjectCallMethod0.proto */ -static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); - -/* RaiseNoneIterError.proto */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - -/* UnpackTupleError.proto */ -static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); - -/* UnpackTuple2.proto */ -#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ - (likely(is_tuple || PyTuple_Check(tuple)) ?\ - (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ - __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ - (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ - __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) -static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( - PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); -static int __Pyx_unpack_tuple2_generic( - PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); - -/* dict_iter.proto */ -static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, - Py_ssize_t* p_orig_length, int* p_is_dict); -static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, - PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); - -/* PyObjectFormatAndDecref.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); - -/* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char); - -/* GetAttr.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); - -/* GCCDiagnostics.proto */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define __Pyx_HAS_GCC_DIAGNOSTIC -#endif - -/* BuildPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, - int prepend_sign, char padding_char); - -/* CIntToPyUnicode.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char); - -/* PyIntCompare.proto */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); - -/* PySequenceContains.proto */ -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -/* SetItemInt.proto */ -#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ - __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) -static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); -static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, - int is_list, int wraparound, int boundscheck); - -/* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -/* py_abs.proto */ -#if CYTHON_USE_PYLONG_INTERNALS -static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); -#define __Pyx_PyNumber_Absolute(x)\ - ((likely(PyLong_CheckExact(x))) ?\ - (likely(__Pyx_PyLong_IsNonNeg(x)) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ - PyNumber_Absolute(x)) -#else -#define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) -#endif - -/* ListAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -/* GetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* pep479.proto */ -static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* IterNext.proto */ -#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) -static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); - -/* GetAttr3.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); - -/* RaiseUnexpectedTypeError.proto */ -static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* HasAttr.proto */ -static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); - -/* IncludeStructmemberH.proto */ -#include - -/* FixUpExtensionType.proto */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -#endif - -/* ValidateBasesTuple.proto */ -#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS -static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); -#endif - -/* PyType_Ready.proto */ -CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); - -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif - -/* PyObject_GenericGetAttr.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr -#endif - -/* SetupReduce.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API -static int __Pyx_setup_reduce(PyObject* type_obj); -#endif - -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif - -/* GetTopmostException.proto */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); -#endif - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); - -/* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif - -/* PyMethodNew.proto */ -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#else - #define __Pyx_PyMethod_New PyMethod_New -#endif - -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); -#endif - -/* CythonFunctionShared.proto */ -#define __Pyx_CyFunction_USED -#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 -#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 -#define __Pyx_CYFUNCTION_CCLASS 0x04 -#define __Pyx_CYFUNCTION_COROUTINE 0x08 -#define __Pyx_CyFunction_GetClosure(f)\ - (((__pyx_CyFunctionObject *) (f))->func_closure) -#if PY_VERSION_HEX < 0x030900B1 - #define __Pyx_CyFunction_GetClassObj(f)\ - (((__pyx_CyFunctionObject *) (f))->func_classobj) -#else - #define __Pyx_CyFunction_GetClassObj(f)\ - ((PyObject*) ((PyCMethodObject *) (f))->mm_class) -#endif -#define __Pyx_CyFunction_SetClassObj(f, classobj)\ - __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) -#define __Pyx_CyFunction_Defaults(type, f)\ - ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) -#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ - ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) -typedef struct { -#if PY_VERSION_HEX < 0x030900B1 - PyCFunctionObject func; -#else - PyCMethodObject func; -#endif -#if CYTHON_BACKPORT_VECTORCALL - __pyx_vectorcallfunc func_vectorcall; -#endif -#if PY_VERSION_HEX < 0x030500A0 - PyObject *func_weakreflist; -#endif - PyObject *func_dict; - PyObject *func_name; - PyObject *func_qualname; - PyObject *func_doc; - PyObject *func_globals; - PyObject *func_code; - PyObject *func_closure; -#if PY_VERSION_HEX < 0x030900B1 - PyObject *func_classobj; -#endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults - int flags; - PyObject *defaults_tuple; - PyObject *defaults_kwdict; - PyObject *(*defaults_getter)(PyObject *); - PyObject *func_annotations; - PyObject *func_is_coroutine; -} __pyx_CyFunctionObject; -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, - PyObject *tuple); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, - PyObject *dict); -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, - PyObject *dict); -static int __pyx_CyFunction_init(PyObject *module); -#if CYTHON_METH_FASTCALL -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL -#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) -#else -#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) -#endif -#endif - -/* CythonFunction.proto */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); - -/* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); -#endif - -/* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int8_t __Pyx_PyInt_As_int8_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); - -/* FormatTypeName.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -typedef PyObject *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); -#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) -#else -typedef const char *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) -#define __Pyx_DECREF_TypeName(obj) -#endif - -/* FastTypeChecks.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); -#else -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) -#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) -#endif -#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) - -/* SwapException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* PyObjectCall2Args.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); - -/* PyObjectCallMethod1.proto */ -static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); - -/* CoroutineBase.proto */ -struct __pyx_CoroutineObject; -typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); -#if CYTHON_USE_EXC_INFO_STACK -#define __Pyx_ExcInfoStruct _PyErr_StackItem -#else -typedef struct { - PyObject *exc_type; - PyObject *exc_value; - PyObject *exc_traceback; -} __Pyx_ExcInfoStruct; -#endif -typedef struct __pyx_CoroutineObject { - PyObject_HEAD - __pyx_coroutine_body_t body; - PyObject *closure; - __Pyx_ExcInfoStruct gi_exc_state; - PyObject *gi_weakreflist; - PyObject *classobj; - PyObject *yieldfrom; - PyObject *gi_name; - PyObject *gi_qualname; - PyObject *gi_modulename; - PyObject *gi_code; - PyObject *gi_frame; - int resume_label; - char is_running; -} __pyx_CoroutineObject; -static __pyx_CoroutineObject *__Pyx__Coroutine_New( - PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name); -static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( - __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name); -static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); -static int __Pyx_Coroutine_clear(PyObject *self); -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); -static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); -#if CYTHON_USE_EXC_INFO_STACK -#define __Pyx_Coroutine_SwapException(self) -#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) -#else -#define __Pyx_Coroutine_SwapException(self) {\ - __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ - __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ - } -#define __Pyx_Coroutine_ResetAndClearException(self) {\ - __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ - (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ - } -#endif -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ - __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) -#else -#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ - __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) -#endif -static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); -static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); - -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); - -/* Generator.proto */ -#define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) -#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) -static PyObject *__Pyx_Generator_Next(PyObject *self); -static int __pyx_Generator_init(PyObject *module); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* FunctionImport.proto */ -static int __Pyx_ImportFunction_3_0_0(PyObject *module, const char *funcname, void (**f)(void), const char *sig); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - -/* #### Code section: module_declarations ### */ - -/* Module declarations from "libc.stdint" */ - -/* Module declarations from "libcpp" */ - -/* Module declarations from "taos._cinterface" */ -static PyObject *(*__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null)(TAOS_RES *, int, int); /*proto*/ -static PyObject *(*__pyx_f_4taos_11_cinterface_taos_fetch_block_v3)(TAOS_RES *, TAOS_FIELD *, int, PyObject *); /*proto*/ - -/* Module declarations from "taos._parser" */ -static PyObject *(*__pyx_f_4taos_7_parser__parse_binary_string)(size_t, int, int); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_nchar_string)(size_t, int, int); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_string)(size_t, int, int *); /*proto*/ -static PyObject *(*__pyx_f_4taos_7_parser__parse_timestamp)(size_t, int, PyObject *, int, PyObject *); /*proto*/ - -/* Module declarations from "taos._objects" */ -static void __pyx_f_4taos_8_objects_async_callback_wrapper(void *, TAOS_RES *, int); /*proto*/ -static PyObject *__pyx_f_4taos_8_objects___pyx_unpickle_TaosCursor__set_state(struct __pyx_obj_4taos_8_objects_TaosCursor *, PyObject *); /*proto*/ -/* #### Code section: typeinfo ### */ -/* #### Code section: before_global_var ### */ -#define __Pyx_MODULE_NAME "taos._objects" -extern int __pyx_module_is_main_taos___objects; -int __pyx_module_is_main_taos___objects = 0; - -/* Implementation of "taos._objects" */ -/* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_OSError; -static PyObject *__pyx_builtin_print; -static PyObject *__pyx_builtin_map; -static PyObject *__pyx_builtin_zip; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_range; -/* #### Code section: string_decls ### */ -static const char __pyx_k_b[] = "b"; -static const char __pyx_k_d[] = "d"; -static const char __pyx_k_f[] = "f"; -static const char __pyx_k_i[] = "i"; -static const char __pyx_k_k[] = "k"; -static const char __pyx_k_r[] = "r"; -static const char __pyx_k_v[] = "v"; -static const char __pyx_k_db[] = "db"; -static const char __pyx_k_dt[] = "dt"; -static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k_tp[] = "tp"; -static const char __pyx_k_tz[] = "tz"; -static const char __pyx_k_UTC[] = "UTC"; -static const char __pyx_k__12[] = ","; -static const char __pyx_k__19[] = "}"; -static const char __pyx_k__63[] = "."; -static const char __pyx_k__64[] = "*"; -static const char __pyx_k_end[] = "end"; -static const char __pyx_k_int[] = "int"; -static const char __pyx_k_k_2[] = "_k"; -static const char __pyx_k_map[] = "map"; -static const char __pyx_k_new[] = "__new__"; -static const char __pyx_k_pos[] = "pos"; -static const char __pyx_k_res[] = "res"; -static const char __pyx_k_row[] = "row"; -static const char __pyx_k_sql[] = "sql"; -static const char __pyx_k_str[] = "str"; -static const char __pyx_k_tta[] = "tta"; -static const char __pyx_k_v_2[] = "_v"; -static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k__101[] = "?"; -static const char __pyx_k_args[] = "args"; -static const char __pyx_k_code[] = "code"; -static const char __pyx_k_data[] = "data"; -static const char __pyx_k_db_2[] = "_db"; -static const char __pyx_k_dict[] = "__dict__"; -static const char __pyx_k_host[] = "host"; -static const char __pyx_k_iter[] = "__iter__"; -static const char __pyx_k_list[] = "list"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "name"; -static const char __pyx_k_poll[] = "poll"; -static const char __pyx_k_port[] = "port"; -static const char __pyx_k_pytz[] = "pytz"; -static const char __pyx_k_root[] = "root"; -static const char __pyx_k_self[] = "self"; -static const char __pyx_k_send[] = "send"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_tp_2[] = "_tp"; -static const char __pyx_k_type[] = "type_"; -static const char __pyx_k_user[] = "user"; -static const char __pyx_k_begin[] = "begin"; -static const char __pyx_k_block[] = "block"; -static const char __pyx_k_bytes[] = "bytes"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_errno[] = "errno"; -static const char __pyx_k_field[] = "field"; -static const char __pyx_k_items[] = "items"; -static const char __pyx_k_print[] = "print"; -static const char __pyx_k_query[] = "query"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_sql_2[] = "_sql"; -static const char __pyx_k_state[] = "state"; -static const char __pyx_k_table[] = "table"; -static const char __pyx_k_throw[] = "throw"; -static const char __pyx_k_topic[] = "topic"; -static const char __pyx_k_utf_8[] = "utf-8"; -static const char __pyx_k_vg_id[] = "vg_id"; -static const char __pyx_k_asdict[] = "_asdict"; -static const char __pyx_k_blocks[] = "blocks"; -static const char __pyx_k_commit[] = "commit"; -static const char __pyx_k_config[] = "config"; -static const char __pyx_k_decode[] = "decode"; -static const char __pyx_k_dict_2[] = "_dict"; -static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_encode[] = "encode"; -static const char __pyx_k_errstr[] = "errstr"; -static const char __pyx_k_fields[] = "fields"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_name_2[] = "__name__"; -static const char __pyx_k_offset[] = "offset"; -static const char __pyx_k_params[] = "params"; -static const char __pyx_k_pblock[] = "pblock"; -static const char __pyx_k_pickle[] = "pickle"; -static const char __pyx_k_reduce[] = "__reduce__"; -static const char __pyx_k_req_id[] = "req_id"; -static const char __pyx_k_set_tz[] = "set_tz"; -static const char __pyx_k_tables[] = "tables"; -static const char __pyx_k_topics[] = "topics"; -static const char __pyx_k_type_2[] = ", type: "; -static const char __pyx_k_type_3[] = "type"; -static const char __pyx_k_typing[] = "typing"; -static const char __pyx_k_update[] = "update"; -static const char __pyx_k_utc_tz[] = "_utc_tz"; -static const char __pyx_k_DictRow[] = "DictRow"; -static const char __pyx_k_OSError[] = "OSError"; -static const char __pyx_k_bytes_2[] = ", bytes: "; -static const char __pyx_k_configs[] = "configs"; -static const char __pyx_k_disable[] = "disable"; -static const char __pyx_k_execute[] = "execute"; -static const char __pyx_k_is_null[] = "is_null"; -static const char __pyx_k_offsets[] = "offsets"; -static const char __pyx_k_priv_tz[] = "_priv_tz"; -static const char __pyx_k_query_a[] = "query_a"; -static const char __pyx_k_seconds[] = "seconds"; -static const char __pyx_k_table_2[] = "_table"; -static const char __pyx_k_timeout[] = "timeout"; -static const char __pyx_k_topic_2[] = "_topic"; -static const char __pyx_k_Optional[] = "Optional"; -static const char __pyx_k_TmqError[] = "TmqError"; -static const char __pyx_k_callback[] = "callback:"; -static const char __pyx_k_database[] = "database"; -static const char __pyx_k_datetime[] = "datetime"; -static const char __pyx_k_dt_epoch[] = "dt_epoch"; -static const char __pyx_k_fetchall[] = "fetchall"; -static const char __pyx_k_fetchone[] = "fetchone"; -static const char __pyx_k_getstate[] = "__getstate__"; -static const char __pyx_k_list_str[] = "list[str]"; -static const char __pyx_k_localize[] = "localize"; -static const char __pyx_k_password[] = "password"; -static const char __pyx_k_position[] = "position"; -static const char __pyx_k_pyx_type[] = "__pyx_type"; -static const char __pyx_k_rollback[] = "rollback"; -static const char __pyx_k_setstate[] = "__setstate__"; -static const char __pyx_k_tables_2[] = "_tables"; -static const char __pyx_k_taos_res[] = "taos_res"; -static const char __pyx_k_taos_row[] = "taos_row"; -static const char __pyx_k_taosdata[] = "taosdata"; -static const char __pyx_k_timezone[] = "timezone"; -static const char __pyx_k_tmq_conf[] = "tmq_conf"; -static const char __pyx_k_tmq_list[] = "tmq_list"; -static const char __pyx_k_TaosField[] = "TaosField"; -static const char __pyx_k_TypeError[] = "TypeError"; -static const char __pyx_k_committed[] = "committed"; -static const char __pyx_k_fetch_all[] = "fetch_all"; -static const char __pyx_k_init_conn[] = "_init_conn"; -static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_pyx_state[] = "__pyx_state"; -static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; -static const char __pyx_k_row_count[] = "row_count"; -static const char __pyx_k_rows_iter[] = "rows_iter"; -static const char __pyx_k_select_db[] = "select_db"; -static const char __pyx_k_subscribe[] = "subscribe"; -static const char __pyx_k_timedelta[] = "timedelta"; -static const char __pyx_k_tmq_errno[] = "tmq_errno"; -static const char __pyx_k_SIZED_TYPE[] = "SIZED_TYPE"; -static const char __pyx_k_TaosCursor[] = "TaosCursor"; -static const char __pyx_k_TaosResult[] = "TaosResult"; -static const char __pyx_k_assignment[] = "assignment"; -static const char __pyx_k_astimezone[] = "astimezone"; -static const char __pyx_k_callback_2[] = "callback"; -static const char __pyx_k_connection[] = "connection"; -static const char __pyx_k_database_2[] = "_database"; -static const char __pyx_k_namedtuple[] = "namedtuple"; -static const char __pyx_k_pyx_result[] = "__pyx_result"; -static const char __pyx_k_taos_error[] = "taos.error"; -static const char __pyx_k_PickleError[] = "PickleError"; -static const char __pyx_k_blocks_iter[] = "blocks_iter"; -static const char __pyx_k_collections[] = "collections"; -static const char __pyx_k_fetch_block[] = "_fetch_block"; -static const char __pyx_k_field_names[] = "field_names"; -static const char __pyx_k_get_db_name[] = "get_db_name"; -static const char __pyx_k_num_of_rows[] = "num_of_rows"; -static const char __pyx_k_offset_seek[] = "offset_seek"; -static const char __pyx_k_unsubscribe[] = "unsubscribe"; -static const char __pyx_k_CONVERT_FUNC[] = "CONVERT_FUNC"; -static const char __pyx_k_Optional_int[] = "Optional[int]"; -static const char __pyx_k_TaosConsumer[] = "TaosConsumer"; -static const char __pyx_k_UNSIZED_TYPE[] = "UNSIZED_TYPE"; -static const char __pyx_k_dict_row_cls[] = "dict_row_cls"; -static const char __pyx_k_dict_str_str[] = "dict[str, str]"; -static const char __pyx_k_fetch_rows_a[] = "fetch_rows_a"; -static const char __pyx_k_init_options[] = "_init_options"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; -static const char __pyx_k_reset_result[] = "_reset_result"; -static const char __pyx_k_stringsource[] = ""; -static const char __pyx_k_tmq_conf_res[] = "tmq_conf_res:"; -static const char __pyx_k_use_setstate[] = "use_setstate"; -static const char __pyx_k_DatabaseError[] = "DatabaseError"; -static const char __pyx_k_InternalError[] = "InternalError"; -static const char __pyx_k_affected_rows[] = "affected_rows"; -static const char __pyx_k_fetch_block_2[] = "fetch_block"; -static const char __pyx_k_fromtimestamp[] = "fromtimestamp"; -static const char __pyx_k_get_vgroup_id[] = "get_vgroup_id"; -static const char __pyx_k_offset_commit[] = "offset_commit"; -static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; -static const char __pyx_k_result_commit[] = "result_commit"; -static const char __pyx_k_taos__objects[] = "taos._objects"; -static const char __pyx_k_StatementError[] = "StatementError"; -static const char __pyx_k_TaosConnection[] = "TaosConnection"; -static const char __pyx_k_TaosField_name[] = "TaosField{name: "; -static const char __pyx_k_TaosResult_res[] = "TaosResult{res: "; - static const char __pyx_k_assignment_ptr[] = "assignment_ptr"; - static const char __pyx_k_current_offset[] = "current_offset"; - static const char __pyx_k_datetime_epoch[] = "_datetime_epoch"; - static const char __pyx_k_get_topic_name[] = "get_topic_name"; - static const char __pyx_k_tmq_conf_res_2[] = "tmq_conf_res"; - static const char __pyx_k_ConnectionError[] = "ConnectionError"; - static const char __pyx_k_load_table_info[] = "load_table_info"; - static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; - static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; - static const char __pyx_k_OperationalError[] = "OperationalError"; - static const char __pyx_k_ProgrammingError[] = "ProgrammingError"; - static const char __pyx_k_TaosCursor_close[] = "TaosCursor.close"; - static const char __pyx_k_check_conn_error[] = "_check_conn_error"; - static const char __pyx_k_clear_result_set[] = "clear_result_set"; - static const char __pyx_k_setup_tmq_failed[] = "setup tmq failed"; - static const char __pyx_k_taos__cinterface[] = "taos._cinterface"; - static const char __pyx_k_utcfromtimestamp[] = "utcfromtimestamp"; - static const char __pyx_k_TaosConsumer_poll[] = "TaosConsumer.poll"; - static const char __pyx_k_TaosCursor___iter[] = "TaosCursor.__iter__"; - static const char __pyx_k_get_vgroup_offset[] = "get_vgroup_offset"; - static const char __pyx_k_num_of_assignment[] = "num_of_assignment"; - static const char __pyx_k_taos__objects_pyx[] = "taos\\_objects.pyx"; - static const char __pyx_k_topic_assignments[] = "topic_assignments"; - static const char __pyx_k_TaosCursor_execute[] = "TaosCursor.execute"; - static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; - static const char __pyx_k_check_result_error[] = "_check_result_error"; - static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; - static const char __pyx_k_utc_datetime_epoch[] = "_utc_datetime_epoch"; - static const char __pyx_k_TaosConsumer_commit[] = "TaosConsumer.commit"; - static const char __pyx_k_TaosCursor_fetchall[] = "TaosCursor.fetchall"; - static const char __pyx_k_TaosCursor_fetchone[] = "TaosCursor.fetchone"; - static const char __pyx_k_TaosTopicAssignment[] = "TaosTopicAssignment"; - static const char __pyx_k_fetch_all_into_dict[] = "fetch_all_into_dict"; - static const char __pyx_k_get_table_vgroup_id[] = "get_table_vgroup_id"; - static const char __pyx_k_priv_datetime_epoch[] = "_priv_datetime_epoch"; - static const char __pyx_k_TaosConnection_close[] = "TaosConnection.close"; - static const char __pyx_k_TaosConnection_query[] = "TaosConnection.query"; - static const char __pyx_k_TaosResult_fetch_all[] = "TaosResult.fetch_all"; - static const char __pyx_k_TaosResult_rows_iter[] = "TaosResult.rows_iter"; - static const char __pyx_k_get_topic_assignment[] = "get_topic_assignment"; - static const char __pyx_k_TaosConnection_commit[] = "TaosConnection.commit"; - static const char __pyx_k_TaosConsumer_position[] = "TaosConsumer.position"; - static const char __pyx_k_select_database_error[] = "select database error"; - static const char __pyx_k_TaosConnection_execute[] = "TaosConnection.execute"; - static const char __pyx_k_TaosConnection_query_a[] = "TaosConnection.query_a"; - static const char __pyx_k_TaosConsumer_committed[] = "TaosConsumer.committed"; - static const char __pyx_k_TaosConsumer_subscribe[] = "TaosConsumer.subscribe"; - static const char __pyx_k_TaosResult_blocks_iter[] = "TaosResult.blocks_iter"; - static const char __pyx_k_TaosResult_fetch_block[] = "TaosResult.fetch_block"; - static const char __pyx_k_set_up_tmq_list_failed[] = "set up tmq list failed!"; - static const char __pyx_k_taos_fetch_raw_block_a[] = "taos_fetch_raw_block_a"; - static const char __pyx_k_Cursor_is_not_connected[] = "Cursor is not connected"; - static const char __pyx_k_Invalid_use_of_fetchall[] = "Invalid use of fetchall"; - static const char __pyx_k_TaosConnection_rollback[] = "TaosConnection.rollback"; - static const char __pyx_k_TaosResult__fetch_block[] = "TaosResult._fetch_block"; - static const char __pyx_k_TaosResult_fetch_rows_a[] = "TaosResult.fetch_rows_a"; - static const char __pyx_k_pyx_unpickle_TaosCursor[] = "__pyx_unpickle_TaosCursor"; - static const char __pyx_k_Invalid_use_of_rows_iter[] = "Invalid use of rows_iter"; - static const char __pyx_k_TaosConnection_select_db[] = "TaosConnection.select_db"; - static const char __pyx_k_TaosConnection_subscribe[] = "TaosConnection.subscribe"; - static const char __pyx_k_TaosConsumer_get_db_name[] = "TaosConsumer.get_db_name"; - static const char __pyx_k_TaosConsumer_offset_seek[] = "TaosConsumer.offset_seek"; - static const char __pyx_k_TaosConsumer_unsubscribe[] = "TaosConsumer.unsubscribe"; - static const char __pyx_k_TaosCursor__reset_result[] = "TaosCursor._reset_result"; - static const char __pyx_k_set_up_tmq_config_failed[] = "set up tmq config failed!"; - static const char __pyx_k_TaosConnection__init_conn[] = "TaosConnection._init_conn"; - static const char __pyx_k_TaosField___reduce_cython[] = "TaosField.__reduce_cython__"; - static const char __pyx_k_TaosConsumer_get_vgroup_id[] = "TaosConsumer.get_vgroup_id"; - static const char __pyx_k_TaosConsumer_offset_commit[] = "TaosConsumer.offset_commit"; - static const char __pyx_k_TaosConsumer_result_commit[] = "TaosConsumer.result_commit"; - static const char __pyx_k_TaosCursor___reduce_cython[] = "TaosCursor.__reduce_cython__"; - static const char __pyx_k_TaosResult___reduce_cython[] = "TaosResult.__reduce_cython__"; - static const char __pyx_k_TaosConsumer_get_topic_name[] = "TaosConsumer.get_topic_name"; - static const char __pyx_k_TaosField___setstate_cython[] = "TaosField.__setstate_cython__"; - static const char __pyx_k_TaosConnection__init_options[] = "TaosConnection._init_options"; - static const char __pyx_k_TaosConsumer___reduce_cython[] = "TaosConsumer.__reduce_cython__"; - static const char __pyx_k_TaosCursor___setstate_cython[] = "TaosCursor.__setstate_cython__"; - static const char __pyx_k_TaosResult___setstate_cython[] = "TaosResult.__setstate_cython__"; - static const char __pyx_k_Invalid_use_of_fetch_iterator[] = "Invalid use of fetch iterator"; - static const char __pyx_k_TaosConnection___reduce_cython[] = "TaosConnection.__reduce_cython__"; - static const char __pyx_k_TaosConnection_load_table_info[] = "TaosConnection.load_table_info"; - static const char __pyx_k_TaosConsumer___setstate_cython[] = "TaosConsumer.__setstate_cython__"; - static const char __pyx_k_TaosConsumer_get_vgroup_offset[] = "TaosConsumer.get_vgroup_offset"; - static const char __pyx_k_TaosResult__check_result_error[] = "TaosResult._check_result_error"; - static const char __pyx_k_TaosResult_fetch_all_into_dict[] = "TaosResult.fetch_all_into_dict"; - static const char __pyx_k_TaosConnection_clear_result_set[] = "TaosConnection.clear_result_set"; - static const char __pyx_k_TaosConnection_get_table_vgroup[] = "TaosConnection.get_table_vgroup_id"; - static const char __pyx_k_TaosResult_taos_fetch_raw_block[] = "TaosResult.taos_fetch_raw_block_a"; - static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))"; - static const char __pyx_k_TaosConnection___setstate_cython[] = "TaosConnection.__setstate_cython__"; - static const char __pyx_k_TaosConnection__check_conn_error[] = "TaosConnection._check_conn_error"; - static const char __pyx_k_TaosConsumer_get_topic_assignmen[] = "TaosConsumer.get_topic_assignment"; - static const char __pyx_k_TaosTopicAssignment___reduce_cyt[] = "TaosTopicAssignment.__reduce_cython__"; - static const char __pyx_k_TaosTopicAssignment___setstate_c[] = "TaosTopicAssignment.__setstate_cython__"; - static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; -/* #### Code section: decls ### */ -static PyObject *__pyx_pf_4taos_8_objects_set_tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */ -static int __pyx_pf_4taos_8_objects_14TaosConnection___cinit__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_user, PyObject *__pyx_v_password, PyObject *__pyx_v_database, PyObject *__pyx_v_port, PyObject *__pyx_v_timezone, PyObject *__pyx_v_config); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_2_init_options(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_4_init_conn(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_6_check_conn_error(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static void __pyx_pf_4taos_8_objects_14TaosConnection_8__dealloc__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_10close(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_11client_info___get__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_11server_info___get__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_12select_db(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_database); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_14execute(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_req_id); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_16query(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_req_id); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_18query_a(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_callback, PyObject *__pyx_v_req_id); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_20subscribe(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_configs, CYTHON_UNUSED PyObject *__pyx_v_callback); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_22load_table_info(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_tables); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_24commit(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_26rollback(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_28clear_result_set(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_30get_table_vgroup_id(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_db, PyObject *__pyx_v_table); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ -static int __pyx_pf_4taos_8_objects_9TaosField___cinit__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, PyObject *__pyx_v_name, int8_t __pyx_v_type_, int32_t __pyx_v_bytes); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4name___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4type___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_5bytes___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_6length___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_2__str__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4__repr__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_6__getitem__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ -static int __pyx_pf_4taos_8_objects_10TaosResult___cinit__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, size_t __pyx_v_res); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_2__str__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_4__repr__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_6__iter__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_6fields___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_11field_count___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_9precision___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_13affected_rows___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_9row_count___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_8_check_result_error(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_10_fetch_block(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_12fetch_block(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_14fetch_all(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_16fetch_all_into_dict(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_18rows_iter(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_21blocks_iter(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_24fetch_rows_a(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ -static void __pyx_pf_4taos_8_objects_10TaosResult_28__dealloc__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ -static int __pyx_pf_4taos_8_objects_10TaosCursor___init__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_connection); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_2__iter__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_11description___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_8rowcount___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_13affected_rows___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_5execute(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, PyObject *__pyx_v_sql, CYTHON_UNUSED PyObject *__pyx_v_params, PyObject *__pyx_v_req_id); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_7fetchone(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_9fetchall(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_11close(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_13_reset_result(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static void __pyx_pf_4taos_8_objects_10TaosCursor_15__del__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_17__reduce_cython__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_19__setstate_cython__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ -static int __pyx_pf_4taos_8_objects_19TaosTopicAssignment___cinit__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self, int32_t __pyx_v_vg_id, int64_t __pyx_v_current_offset, int64_t __pyx_v_begin, int64_t __pyx_v_end); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_5vg_id___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_14current_offset___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_5begin___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_3end___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ -static int __pyx_pf_4taos_8_objects_12TaosConsumer___cinit__(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_configs); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_2subscribe(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topics); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_4unsubscribe(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_6poll(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_8commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_10result_commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_12offset_commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id, PyObject *__pyx_v_offset); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_14get_topic_assignment(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_16offset_seek(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id, PyObject *__pyx_v_offset); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_18position(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_20committed(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_22get_topic_name(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_24get_db_name(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_26get_vgroup_id(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_28get_vgroup_offset(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res); /* proto */ -static void __pyx_pf_4taos_8_objects_12TaosConsumer_30__dealloc__(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_4taos_8_objects_2__pyx_unpickle_TaosCursor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_tp_new_4taos_8_objects_TaosConnection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4taos_8_objects_TaosField(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4taos_8_objects_TaosResult(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4taos_8_objects_TaosCursor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4taos_8_objects_TaosTopicAssignment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4taos_8_objects_TaosConsumer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -/* #### Code section: late_includes ### */ -/* #### Code section: module_state ### */ -typedef struct { - PyObject *__pyx_d; - PyObject *__pyx_b; - PyObject *__pyx_cython_runtime; - PyObject *__pyx_empty_tuple; - PyObject *__pyx_empty_bytes; - PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - PyObject *__pyx_type_4taos_8_objects_TaosConnection; - PyObject *__pyx_type_4taos_8_objects_TaosField; - PyObject *__pyx_type_4taos_8_objects_TaosResult; - PyObject *__pyx_type_4taos_8_objects_TaosCursor; - PyObject *__pyx_type_4taos_8_objects_TaosTopicAssignment; - PyObject *__pyx_type_4taos_8_objects_TaosConsumer; - PyObject *__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter; - PyObject *__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter; - PyObject *__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__; - #endif - PyTypeObject *__pyx_ptype_4taos_8_objects_TaosConnection; - PyTypeObject *__pyx_ptype_4taos_8_objects_TaosField; - PyTypeObject *__pyx_ptype_4taos_8_objects_TaosResult; - PyTypeObject *__pyx_ptype_4taos_8_objects_TaosCursor; - PyTypeObject *__pyx_ptype_4taos_8_objects_TaosTopicAssignment; - PyTypeObject *__pyx_ptype_4taos_8_objects_TaosConsumer; - PyTypeObject *__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter; - PyTypeObject *__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter; - PyTypeObject *__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__; - PyObject *__pyx_n_s_CONVERT_FUNC; - PyObject *__pyx_n_s_ConnectionError; - PyObject *__pyx_kp_u_Cursor_is_not_connected; - PyObject *__pyx_n_s_DatabaseError; - PyObject *__pyx_n_u_DictRow; - PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; - PyObject *__pyx_n_s_InternalError; - PyObject *__pyx_kp_u_Invalid_use_of_fetch_iterator; - PyObject *__pyx_kp_u_Invalid_use_of_fetchall; - PyObject *__pyx_kp_u_Invalid_use_of_rows_iter; - PyObject *__pyx_n_s_OSError; - PyObject *__pyx_n_s_OperationalError; - PyObject *__pyx_n_s_Optional; - PyObject *__pyx_kp_s_Optional_int; - PyObject *__pyx_n_s_PickleError; - PyObject *__pyx_n_s_ProgrammingError; - PyObject *__pyx_n_s_SIZED_TYPE; - PyObject *__pyx_n_s_StatementError; - PyObject *__pyx_n_s_TaosConnection; - PyObject *__pyx_n_s_TaosConnection___reduce_cython; - PyObject *__pyx_n_s_TaosConnection___setstate_cython; - PyObject *__pyx_n_s_TaosConnection__check_conn_error; - PyObject *__pyx_n_s_TaosConnection__init_conn; - PyObject *__pyx_n_s_TaosConnection__init_options; - PyObject *__pyx_n_s_TaosConnection_clear_result_set; - PyObject *__pyx_n_s_TaosConnection_close; - PyObject *__pyx_n_s_TaosConnection_commit; - PyObject *__pyx_n_s_TaosConnection_execute; - PyObject *__pyx_n_s_TaosConnection_get_table_vgroup; - PyObject *__pyx_n_s_TaosConnection_load_table_info; - PyObject *__pyx_n_s_TaosConnection_query; - PyObject *__pyx_n_s_TaosConnection_query_a; - PyObject *__pyx_n_s_TaosConnection_rollback; - PyObject *__pyx_n_s_TaosConnection_select_db; - PyObject *__pyx_n_s_TaosConnection_subscribe; - PyObject *__pyx_n_s_TaosConsumer; - PyObject *__pyx_n_s_TaosConsumer___reduce_cython; - PyObject *__pyx_n_s_TaosConsumer___setstate_cython; - PyObject *__pyx_n_s_TaosConsumer_commit; - PyObject *__pyx_n_s_TaosConsumer_committed; - PyObject *__pyx_n_s_TaosConsumer_get_db_name; - PyObject *__pyx_n_s_TaosConsumer_get_topic_assignmen; - PyObject *__pyx_n_s_TaosConsumer_get_topic_name; - PyObject *__pyx_n_s_TaosConsumer_get_vgroup_id; - PyObject *__pyx_n_s_TaosConsumer_get_vgroup_offset; - PyObject *__pyx_n_s_TaosConsumer_offset_commit; - PyObject *__pyx_n_s_TaosConsumer_offset_seek; - PyObject *__pyx_n_s_TaosConsumer_poll; - PyObject *__pyx_n_s_TaosConsumer_position; - PyObject *__pyx_n_s_TaosConsumer_result_commit; - PyObject *__pyx_n_s_TaosConsumer_subscribe; - PyObject *__pyx_n_s_TaosConsumer_unsubscribe; - PyObject *__pyx_n_s_TaosCursor; - PyObject *__pyx_n_s_TaosCursor___iter; - PyObject *__pyx_n_s_TaosCursor___reduce_cython; - PyObject *__pyx_n_s_TaosCursor___setstate_cython; - PyObject *__pyx_n_s_TaosCursor__reset_result; - PyObject *__pyx_n_s_TaosCursor_close; - PyObject *__pyx_n_s_TaosCursor_execute; - PyObject *__pyx_n_s_TaosCursor_fetchall; - PyObject *__pyx_n_s_TaosCursor_fetchone; - PyObject *__pyx_n_s_TaosField; - PyObject *__pyx_n_s_TaosField___reduce_cython; - PyObject *__pyx_n_s_TaosField___setstate_cython; - PyObject *__pyx_kp_u_TaosField_name; - PyObject *__pyx_n_s_TaosResult; - PyObject *__pyx_n_s_TaosResult___reduce_cython; - PyObject *__pyx_n_s_TaosResult___setstate_cython; - PyObject *__pyx_n_s_TaosResult__check_result_error; - PyObject *__pyx_n_s_TaosResult__fetch_block; - PyObject *__pyx_n_s_TaosResult_blocks_iter; - PyObject *__pyx_n_s_TaosResult_fetch_all; - PyObject *__pyx_n_s_TaosResult_fetch_all_into_dict; - PyObject *__pyx_n_s_TaosResult_fetch_block; - PyObject *__pyx_n_s_TaosResult_fetch_rows_a; - PyObject *__pyx_kp_u_TaosResult_res; - PyObject *__pyx_n_s_TaosResult_rows_iter; - PyObject *__pyx_n_s_TaosResult_taos_fetch_raw_block; - PyObject *__pyx_n_s_TaosTopicAssignment; - PyObject *__pyx_n_s_TaosTopicAssignment___reduce_cyt; - PyObject *__pyx_n_s_TaosTopicAssignment___setstate_c; - PyObject *__pyx_n_s_TmqError; - PyObject *__pyx_n_s_TypeError; - PyObject *__pyx_n_s_UNSIZED_TYPE; - PyObject *__pyx_n_u_UTC; - PyObject *__pyx_n_s__101; - PyObject *__pyx_kp_u__12; - PyObject *__pyx_kp_u__19; - PyObject *__pyx_kp_u__63; - PyObject *__pyx_n_s__64; - PyObject *__pyx_n_s_affected_rows; - PyObject *__pyx_n_s_args; - PyObject *__pyx_n_s_asdict; - PyObject *__pyx_n_s_assignment; - PyObject *__pyx_n_s_assignment_ptr; - PyObject *__pyx_n_s_astimezone; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_b; - PyObject *__pyx_n_s_begin; - PyObject *__pyx_n_s_block; - PyObject *__pyx_n_s_blocks; - PyObject *__pyx_n_s_blocks_iter; - PyObject *__pyx_n_s_bytes; - PyObject *__pyx_kp_u_bytes_2; - PyObject *__pyx_kp_u_callback; - PyObject *__pyx_n_s_callback_2; - PyObject *__pyx_n_s_check_conn_error; - PyObject *__pyx_n_s_check_result_error; - PyObject *__pyx_n_s_clear_result_set; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_code; - PyObject *__pyx_n_s_collections; - PyObject *__pyx_n_s_commit; - PyObject *__pyx_n_s_committed; - PyObject *__pyx_n_s_config; - PyObject *__pyx_n_s_configs; - PyObject *__pyx_n_s_connection; - PyObject *__pyx_n_s_current_offset; - PyObject *__pyx_n_u_d; - PyObject *__pyx_n_s_data; - PyObject *__pyx_n_s_database; - PyObject *__pyx_n_s_database_2; - PyObject *__pyx_n_s_datetime; - PyObject *__pyx_n_s_datetime_epoch; - PyObject *__pyx_n_s_db; - PyObject *__pyx_n_s_db_2; - PyObject *__pyx_n_s_decode; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_n_s_dict_2; - PyObject *__pyx_n_s_dict_row_cls; - PyObject *__pyx_kp_s_dict_str_str; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_dt; - PyObject *__pyx_n_s_dt_epoch; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_encode; - PyObject *__pyx_n_s_end; - PyObject *__pyx_n_s_errno; - PyObject *__pyx_n_s_errstr; - PyObject *__pyx_n_s_execute; - PyObject *__pyx_n_s_f; - PyObject *__pyx_n_s_fetch_all; - PyObject *__pyx_n_s_fetch_all_into_dict; - PyObject *__pyx_n_s_fetch_block; - PyObject *__pyx_n_s_fetch_block_2; - PyObject *__pyx_n_s_fetch_rows_a; - PyObject *__pyx_n_s_fetchall; - PyObject *__pyx_n_s_fetchone; - PyObject *__pyx_n_s_field; - PyObject *__pyx_n_s_field_names; - PyObject *__pyx_n_s_fields; - PyObject *__pyx_n_s_fromtimestamp; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_get_db_name; - PyObject *__pyx_n_s_get_table_vgroup_id; - PyObject *__pyx_n_s_get_topic_assignment; - PyObject *__pyx_n_s_get_topic_name; - PyObject *__pyx_n_s_get_vgroup_id; - PyObject *__pyx_n_s_get_vgroup_offset; - PyObject *__pyx_n_s_getstate; - PyObject *__pyx_n_s_host; - PyObject *__pyx_n_s_i; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_init_conn; - PyObject *__pyx_n_s_init_options; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_int; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_s_is_null; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_n_s_items; - PyObject *__pyx_n_s_iter; - PyObject *__pyx_n_s_k; - PyObject *__pyx_n_s_k_2; - PyObject *__pyx_n_s_list; - PyObject *__pyx_kp_s_list_str; - PyObject *__pyx_n_s_load_table_info; - PyObject *__pyx_n_s_localize; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_map; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_name_2; - PyObject *__pyx_n_s_namedtuple; - PyObject *__pyx_n_s_new; - PyObject *__pyx_kp_s_no_default___reduce___due_to_non; - PyObject *__pyx_n_s_num_of_assignment; - PyObject *__pyx_n_s_num_of_rows; - PyObject *__pyx_n_s_offset; - PyObject *__pyx_n_s_offset_commit; - PyObject *__pyx_n_s_offset_seek; - PyObject *__pyx_n_s_offsets; - PyObject *__pyx_n_s_params; - PyObject *__pyx_n_s_password; - PyObject *__pyx_n_s_pblock; - PyObject *__pyx_n_s_pickle; - PyObject *__pyx_n_s_poll; - PyObject *__pyx_n_s_port; - PyObject *__pyx_n_s_pos; - PyObject *__pyx_n_s_position; - PyObject *__pyx_n_s_print; - PyObject *__pyx_n_s_priv_datetime_epoch; - PyObject *__pyx_n_s_priv_tz; - PyObject *__pyx_n_s_pytz; - PyObject *__pyx_n_s_pyx_PickleError; - PyObject *__pyx_n_s_pyx_checksum; - PyObject *__pyx_n_s_pyx_result; - PyObject *__pyx_n_s_pyx_state; - PyObject *__pyx_n_s_pyx_type; - PyObject *__pyx_n_s_pyx_unpickle_TaosCursor; - PyObject *__pyx_n_s_query; - PyObject *__pyx_n_s_query_a; - PyObject *__pyx_n_s_r; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_reduce; - PyObject *__pyx_n_s_reduce_cython; - PyObject *__pyx_n_s_reduce_ex; - PyObject *__pyx_n_s_req_id; - PyObject *__pyx_n_s_res; - PyObject *__pyx_n_s_reset_result; - PyObject *__pyx_n_s_result_commit; - PyObject *__pyx_n_s_rollback; - PyObject *__pyx_n_u_root; - PyObject *__pyx_n_s_row; - PyObject *__pyx_n_s_row_count; - PyObject *__pyx_n_s_rows_iter; - PyObject *__pyx_n_s_seconds; - PyObject *__pyx_kp_u_select_database_error; - PyObject *__pyx_n_s_select_db; - PyObject *__pyx_n_s_self; - PyObject *__pyx_n_s_send; - PyObject *__pyx_n_s_set_tz; - PyObject *__pyx_kp_u_set_up_tmq_config_failed; - PyObject *__pyx_kp_u_set_up_tmq_list_failed; - PyObject *__pyx_n_s_setstate; - PyObject *__pyx_n_s_setstate_cython; - PyObject *__pyx_kp_u_setup_tmq_failed; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_sql; - PyObject *__pyx_n_s_sql_2; - PyObject *__pyx_n_s_state; - PyObject *__pyx_n_s_str; - PyObject *__pyx_kp_s_stringsource; - PyObject *__pyx_n_s_subscribe; - PyObject *__pyx_n_s_table; - PyObject *__pyx_n_s_table_2; - PyObject *__pyx_n_s_tables; - PyObject *__pyx_n_s_tables_2; - PyObject *__pyx_n_s_taos__cinterface; - PyObject *__pyx_n_s_taos__objects; - PyObject *__pyx_kp_s_taos__objects_pyx; - PyObject *__pyx_n_s_taos_error; - PyObject *__pyx_n_s_taos_fetch_raw_block_a; - PyObject *__pyx_n_s_taos_res; - PyObject *__pyx_n_s_taos_row; - PyObject *__pyx_n_u_taosdata; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_throw; - PyObject *__pyx_n_s_timedelta; - PyObject *__pyx_n_s_timeout; - PyObject *__pyx_n_s_timezone; - PyObject *__pyx_n_s_tmq_conf; - PyObject *__pyx_kp_u_tmq_conf_res; - PyObject *__pyx_n_s_tmq_conf_res_2; - PyObject *__pyx_n_s_tmq_errno; - PyObject *__pyx_n_s_tmq_list; - PyObject *__pyx_n_s_topic; - PyObject *__pyx_n_s_topic_2; - PyObject *__pyx_n_s_topic_assignments; - PyObject *__pyx_n_s_topics; - PyObject *__pyx_n_s_tp; - PyObject *__pyx_n_s_tp_2; - PyObject *__pyx_n_s_tta; - PyObject *__pyx_n_s_type; - PyObject *__pyx_kp_u_type_2; - PyObject *__pyx_n_s_type_3; - PyObject *__pyx_n_s_typing; - PyObject *__pyx_n_s_tz; - PyObject *__pyx_n_s_unsubscribe; - PyObject *__pyx_n_s_update; - PyObject *__pyx_n_s_use_setstate; - PyObject *__pyx_n_s_user; - PyObject *__pyx_n_s_utc_datetime_epoch; - PyObject *__pyx_n_s_utc_tz; - PyObject *__pyx_n_s_utcfromtimestamp; - PyObject *__pyx_kp_u_utf_8; - PyObject *__pyx_n_s_v; - PyObject *__pyx_n_s_v_2; - PyObject *__pyx_n_s_vg_id; - PyObject *__pyx_n_s_zip; - PyObject *__pyx_int_0; - PyObject *__pyx_int_1; - PyObject *__pyx_int_86400; - PyObject *__pyx_int_17084266; - PyObject *__pyx_int_126557407; - PyObject *__pyx_int_199624353; - PyObject *__pyx_codeobj_; - PyObject *__pyx_tuple__42; - PyObject *__pyx_tuple__43; - PyObject *__pyx_tuple__45; - PyObject *__pyx_tuple__62; - PyObject *__pyx_tuple__65; - PyObject *__pyx_tuple__66; - PyObject *__pyx_tuple__67; - PyObject *__pyx_tuple__68; - PyObject *__pyx_tuple__69; - PyObject *__pyx_tuple__70; - PyObject *__pyx_tuple__71; - PyObject *__pyx_tuple__72; - PyObject *__pyx_tuple__73; - PyObject *__pyx_tuple__74; - PyObject *__pyx_tuple__75; - PyObject *__pyx_tuple__76; - PyObject *__pyx_tuple__77; - PyObject *__pyx_tuple__78; - PyObject *__pyx_tuple__79; - PyObject *__pyx_tuple__80; - PyObject *__pyx_tuple__81; - PyObject *__pyx_tuple__82; - PyObject *__pyx_tuple__83; - PyObject *__pyx_tuple__84; - PyObject *__pyx_tuple__85; - PyObject *__pyx_tuple__86; - PyObject *__pyx_tuple__87; - PyObject *__pyx_tuple__88; - PyObject *__pyx_tuple__89; - PyObject *__pyx_tuple__90; - PyObject *__pyx_tuple__91; - PyObject *__pyx_tuple__92; - PyObject *__pyx_tuple__93; - PyObject *__pyx_tuple__94; - PyObject *__pyx_tuple__95; - PyObject *__pyx_tuple__96; - PyObject *__pyx_tuple__97; - PyObject *__pyx_tuple__98; - PyObject *__pyx_tuple__99; - PyObject *__pyx_codeobj__2; - PyObject *__pyx_codeobj__3; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__5; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__7; - PyObject *__pyx_codeobj__8; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_tuple__100; - PyObject *__pyx_codeobj__10; - PyObject *__pyx_codeobj__11; - PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__14; - PyObject *__pyx_codeobj__15; - PyObject *__pyx_codeobj__16; - PyObject *__pyx_codeobj__17; - PyObject *__pyx_codeobj__18; - PyObject *__pyx_codeobj__20; - PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__22; - PyObject *__pyx_codeobj__23; - PyObject *__pyx_codeobj__24; - PyObject *__pyx_codeobj__25; - PyObject *__pyx_codeobj__26; - PyObject *__pyx_codeobj__27; - PyObject *__pyx_codeobj__28; - PyObject *__pyx_codeobj__29; - PyObject *__pyx_codeobj__30; - PyObject *__pyx_codeobj__31; - PyObject *__pyx_codeobj__32; - PyObject *__pyx_codeobj__33; - PyObject *__pyx_codeobj__34; - PyObject *__pyx_codeobj__35; - PyObject *__pyx_codeobj__36; - PyObject *__pyx_codeobj__37; - PyObject *__pyx_codeobj__38; - PyObject *__pyx_codeobj__39; - PyObject *__pyx_codeobj__40; - PyObject *__pyx_codeobj__41; - PyObject *__pyx_codeobj__44; - PyObject *__pyx_codeobj__46; - PyObject *__pyx_codeobj__47; - PyObject *__pyx_codeobj__48; - PyObject *__pyx_codeobj__49; - PyObject *__pyx_codeobj__50; - PyObject *__pyx_codeobj__51; - PyObject *__pyx_codeobj__52; - PyObject *__pyx_codeobj__53; - PyObject *__pyx_codeobj__54; - PyObject *__pyx_codeobj__55; - PyObject *__pyx_codeobj__56; - PyObject *__pyx_codeobj__57; - PyObject *__pyx_codeobj__58; - PyObject *__pyx_codeobj__59; - PyObject *__pyx_codeobj__60; - PyObject *__pyx_codeobj__61; -} __pyx_mstate; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { - extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstate __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosConnection); - Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosConnection); - Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosField); - Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosField); - Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosResult); - Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosResult); - Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosCursor); - Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosCursor); - Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosTopicAssignment); - Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosTopicAssignment); - Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects_TaosConsumer); - Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects_TaosConsumer); - Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter); - Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter); - Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter); - Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter); - Py_CLEAR(clear_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__); - Py_CLEAR(clear_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__); - Py_CLEAR(clear_module_state->__pyx_n_s_CONVERT_FUNC); - Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionError); - Py_CLEAR(clear_module_state->__pyx_kp_u_Cursor_is_not_connected); - Py_CLEAR(clear_module_state->__pyx_n_s_DatabaseError); - Py_CLEAR(clear_module_state->__pyx_n_u_DictRow); - Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); - Py_CLEAR(clear_module_state->__pyx_n_s_InternalError); - Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_use_of_fetch_iterator); - Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_use_of_fetchall); - Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_use_of_rows_iter); - Py_CLEAR(clear_module_state->__pyx_n_s_OSError); - Py_CLEAR(clear_module_state->__pyx_n_s_OperationalError); - Py_CLEAR(clear_module_state->__pyx_n_s_Optional); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_int); - Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); - Py_CLEAR(clear_module_state->__pyx_n_s_ProgrammingError); - Py_CLEAR(clear_module_state->__pyx_n_s_SIZED_TYPE); - Py_CLEAR(clear_module_state->__pyx_n_s_StatementError); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection___reduce_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection___setstate_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection__check_conn_error); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection__init_conn); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection__init_options); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_clear_result_set); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_close); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_commit); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_execute); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_get_table_vgroup); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_load_table_info); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_query); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_query_a); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_rollback); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_select_db); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConnection_subscribe); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer___reduce_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer___setstate_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_commit); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_committed); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_db_name); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_topic_assignmen); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_topic_name); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_vgroup_id); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_get_vgroup_offset); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_offset_commit); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_offset_seek); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_poll); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_position); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_result_commit); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_subscribe); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosConsumer_unsubscribe); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor___iter); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor___reduce_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor___setstate_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor__reset_result); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor_close); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor_execute); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor_fetchall); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosCursor_fetchone); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosField); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosField___reduce_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosField___setstate_cython); - Py_CLEAR(clear_module_state->__pyx_kp_u_TaosField_name); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult___reduce_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult___setstate_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult__check_result_error); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult__fetch_block); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_blocks_iter); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_fetch_all); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_fetch_all_into_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_fetch_block); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_fetch_rows_a); - Py_CLEAR(clear_module_state->__pyx_kp_u_TaosResult_res); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_rows_iter); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosResult_taos_fetch_raw_block); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosTopicAssignment); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosTopicAssignment___reduce_cyt); - Py_CLEAR(clear_module_state->__pyx_n_s_TaosTopicAssignment___setstate_c); - Py_CLEAR(clear_module_state->__pyx_n_s_TmqError); - Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); - Py_CLEAR(clear_module_state->__pyx_n_s_UNSIZED_TYPE); - Py_CLEAR(clear_module_state->__pyx_n_u_UTC); - Py_CLEAR(clear_module_state->__pyx_n_s__101); - Py_CLEAR(clear_module_state->__pyx_kp_u__12); - Py_CLEAR(clear_module_state->__pyx_kp_u__19); - Py_CLEAR(clear_module_state->__pyx_kp_u__63); - Py_CLEAR(clear_module_state->__pyx_n_s__64); - Py_CLEAR(clear_module_state->__pyx_n_s_affected_rows); - Py_CLEAR(clear_module_state->__pyx_n_s_args); - Py_CLEAR(clear_module_state->__pyx_n_s_asdict); - Py_CLEAR(clear_module_state->__pyx_n_s_assignment); - Py_CLEAR(clear_module_state->__pyx_n_s_assignment_ptr); - Py_CLEAR(clear_module_state->__pyx_n_s_astimezone); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_b); - Py_CLEAR(clear_module_state->__pyx_n_s_begin); - Py_CLEAR(clear_module_state->__pyx_n_s_block); - Py_CLEAR(clear_module_state->__pyx_n_s_blocks); - Py_CLEAR(clear_module_state->__pyx_n_s_blocks_iter); - Py_CLEAR(clear_module_state->__pyx_n_s_bytes); - Py_CLEAR(clear_module_state->__pyx_kp_u_bytes_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_callback); - Py_CLEAR(clear_module_state->__pyx_n_s_callback_2); - Py_CLEAR(clear_module_state->__pyx_n_s_check_conn_error); - Py_CLEAR(clear_module_state->__pyx_n_s_check_result_error); - Py_CLEAR(clear_module_state->__pyx_n_s_clear_result_set); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_code); - Py_CLEAR(clear_module_state->__pyx_n_s_collections); - Py_CLEAR(clear_module_state->__pyx_n_s_commit); - Py_CLEAR(clear_module_state->__pyx_n_s_committed); - Py_CLEAR(clear_module_state->__pyx_n_s_config); - Py_CLEAR(clear_module_state->__pyx_n_s_configs); - Py_CLEAR(clear_module_state->__pyx_n_s_connection); - Py_CLEAR(clear_module_state->__pyx_n_s_current_offset); - Py_CLEAR(clear_module_state->__pyx_n_u_d); - Py_CLEAR(clear_module_state->__pyx_n_s_data); - Py_CLEAR(clear_module_state->__pyx_n_s_database); - Py_CLEAR(clear_module_state->__pyx_n_s_database_2); - Py_CLEAR(clear_module_state->__pyx_n_s_datetime); - Py_CLEAR(clear_module_state->__pyx_n_s_datetime_epoch); - Py_CLEAR(clear_module_state->__pyx_n_s_db); - Py_CLEAR(clear_module_state->__pyx_n_s_db_2); - Py_CLEAR(clear_module_state->__pyx_n_s_decode); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); - Py_CLEAR(clear_module_state->__pyx_n_s_dict_row_cls); - Py_CLEAR(clear_module_state->__pyx_kp_s_dict_str_str); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_dt); - Py_CLEAR(clear_module_state->__pyx_n_s_dt_epoch); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_encode); - Py_CLEAR(clear_module_state->__pyx_n_s_end); - Py_CLEAR(clear_module_state->__pyx_n_s_errno); - Py_CLEAR(clear_module_state->__pyx_n_s_errstr); - Py_CLEAR(clear_module_state->__pyx_n_s_execute); - Py_CLEAR(clear_module_state->__pyx_n_s_f); - Py_CLEAR(clear_module_state->__pyx_n_s_fetch_all); - Py_CLEAR(clear_module_state->__pyx_n_s_fetch_all_into_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_fetch_block); - Py_CLEAR(clear_module_state->__pyx_n_s_fetch_block_2); - Py_CLEAR(clear_module_state->__pyx_n_s_fetch_rows_a); - Py_CLEAR(clear_module_state->__pyx_n_s_fetchall); - Py_CLEAR(clear_module_state->__pyx_n_s_fetchone); - Py_CLEAR(clear_module_state->__pyx_n_s_field); - Py_CLEAR(clear_module_state->__pyx_n_s_field_names); - Py_CLEAR(clear_module_state->__pyx_n_s_fields); - Py_CLEAR(clear_module_state->__pyx_n_s_fromtimestamp); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_get_db_name); - Py_CLEAR(clear_module_state->__pyx_n_s_get_table_vgroup_id); - Py_CLEAR(clear_module_state->__pyx_n_s_get_topic_assignment); - Py_CLEAR(clear_module_state->__pyx_n_s_get_topic_name); - Py_CLEAR(clear_module_state->__pyx_n_s_get_vgroup_id); - Py_CLEAR(clear_module_state->__pyx_n_s_get_vgroup_offset); - Py_CLEAR(clear_module_state->__pyx_n_s_getstate); - Py_CLEAR(clear_module_state->__pyx_n_s_host); - Py_CLEAR(clear_module_state->__pyx_n_s_i); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_init_conn); - Py_CLEAR(clear_module_state->__pyx_n_s_init_options); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_int); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_s_is_null); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_n_s_items); - Py_CLEAR(clear_module_state->__pyx_n_s_iter); - Py_CLEAR(clear_module_state->__pyx_n_s_k); - Py_CLEAR(clear_module_state->__pyx_n_s_k_2); - Py_CLEAR(clear_module_state->__pyx_n_s_list); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_str); - Py_CLEAR(clear_module_state->__pyx_n_s_load_table_info); - Py_CLEAR(clear_module_state->__pyx_n_s_localize); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_map); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_name_2); - Py_CLEAR(clear_module_state->__pyx_n_s_namedtuple); - Py_CLEAR(clear_module_state->__pyx_n_s_new); - Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); - Py_CLEAR(clear_module_state->__pyx_n_s_num_of_assignment); - Py_CLEAR(clear_module_state->__pyx_n_s_num_of_rows); - Py_CLEAR(clear_module_state->__pyx_n_s_offset); - Py_CLEAR(clear_module_state->__pyx_n_s_offset_commit); - Py_CLEAR(clear_module_state->__pyx_n_s_offset_seek); - Py_CLEAR(clear_module_state->__pyx_n_s_offsets); - Py_CLEAR(clear_module_state->__pyx_n_s_params); - Py_CLEAR(clear_module_state->__pyx_n_s_password); - Py_CLEAR(clear_module_state->__pyx_n_s_pblock); - Py_CLEAR(clear_module_state->__pyx_n_s_pickle); - Py_CLEAR(clear_module_state->__pyx_n_s_poll); - Py_CLEAR(clear_module_state->__pyx_n_s_port); - Py_CLEAR(clear_module_state->__pyx_n_s_pos); - Py_CLEAR(clear_module_state->__pyx_n_s_position); - Py_CLEAR(clear_module_state->__pyx_n_s_print); - Py_CLEAR(clear_module_state->__pyx_n_s_priv_datetime_epoch); - Py_CLEAR(clear_module_state->__pyx_n_s_priv_tz); - Py_CLEAR(clear_module_state->__pyx_n_s_pytz); - Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); - Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); - Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); - Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); - Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); - Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_TaosCursor); - Py_CLEAR(clear_module_state->__pyx_n_s_query); - Py_CLEAR(clear_module_state->__pyx_n_s_query_a); - Py_CLEAR(clear_module_state->__pyx_n_s_r); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_reduce); - Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); - Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); - Py_CLEAR(clear_module_state->__pyx_n_s_req_id); - Py_CLEAR(clear_module_state->__pyx_n_s_res); - Py_CLEAR(clear_module_state->__pyx_n_s_reset_result); - Py_CLEAR(clear_module_state->__pyx_n_s_result_commit); - Py_CLEAR(clear_module_state->__pyx_n_s_rollback); - Py_CLEAR(clear_module_state->__pyx_n_u_root); - Py_CLEAR(clear_module_state->__pyx_n_s_row); - Py_CLEAR(clear_module_state->__pyx_n_s_row_count); - Py_CLEAR(clear_module_state->__pyx_n_s_rows_iter); - Py_CLEAR(clear_module_state->__pyx_n_s_seconds); - Py_CLEAR(clear_module_state->__pyx_kp_u_select_database_error); - Py_CLEAR(clear_module_state->__pyx_n_s_select_db); - Py_CLEAR(clear_module_state->__pyx_n_s_self); - Py_CLEAR(clear_module_state->__pyx_n_s_send); - Py_CLEAR(clear_module_state->__pyx_n_s_set_tz); - Py_CLEAR(clear_module_state->__pyx_kp_u_set_up_tmq_config_failed); - Py_CLEAR(clear_module_state->__pyx_kp_u_set_up_tmq_list_failed); - Py_CLEAR(clear_module_state->__pyx_n_s_setstate); - Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); - Py_CLEAR(clear_module_state->__pyx_kp_u_setup_tmq_failed); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_sql); - Py_CLEAR(clear_module_state->__pyx_n_s_sql_2); - Py_CLEAR(clear_module_state->__pyx_n_s_state); - Py_CLEAR(clear_module_state->__pyx_n_s_str); - Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); - Py_CLEAR(clear_module_state->__pyx_n_s_subscribe); - Py_CLEAR(clear_module_state->__pyx_n_s_table); - Py_CLEAR(clear_module_state->__pyx_n_s_table_2); - Py_CLEAR(clear_module_state->__pyx_n_s_tables); - Py_CLEAR(clear_module_state->__pyx_n_s_tables_2); - Py_CLEAR(clear_module_state->__pyx_n_s_taos__cinterface); - Py_CLEAR(clear_module_state->__pyx_n_s_taos__objects); - Py_CLEAR(clear_module_state->__pyx_kp_s_taos__objects_pyx); - Py_CLEAR(clear_module_state->__pyx_n_s_taos_error); - Py_CLEAR(clear_module_state->__pyx_n_s_taos_fetch_raw_block_a); - Py_CLEAR(clear_module_state->__pyx_n_s_taos_res); - Py_CLEAR(clear_module_state->__pyx_n_s_taos_row); - Py_CLEAR(clear_module_state->__pyx_n_u_taosdata); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_throw); - Py_CLEAR(clear_module_state->__pyx_n_s_timedelta); - Py_CLEAR(clear_module_state->__pyx_n_s_timeout); - Py_CLEAR(clear_module_state->__pyx_n_s_timezone); - Py_CLEAR(clear_module_state->__pyx_n_s_tmq_conf); - Py_CLEAR(clear_module_state->__pyx_kp_u_tmq_conf_res); - Py_CLEAR(clear_module_state->__pyx_n_s_tmq_conf_res_2); - Py_CLEAR(clear_module_state->__pyx_n_s_tmq_errno); - Py_CLEAR(clear_module_state->__pyx_n_s_tmq_list); - Py_CLEAR(clear_module_state->__pyx_n_s_topic); - Py_CLEAR(clear_module_state->__pyx_n_s_topic_2); - Py_CLEAR(clear_module_state->__pyx_n_s_topic_assignments); - Py_CLEAR(clear_module_state->__pyx_n_s_topics); - Py_CLEAR(clear_module_state->__pyx_n_s_tp); - Py_CLEAR(clear_module_state->__pyx_n_s_tp_2); - Py_CLEAR(clear_module_state->__pyx_n_s_tta); - Py_CLEAR(clear_module_state->__pyx_n_s_type); - Py_CLEAR(clear_module_state->__pyx_kp_u_type_2); - Py_CLEAR(clear_module_state->__pyx_n_s_type_3); - Py_CLEAR(clear_module_state->__pyx_n_s_typing); - Py_CLEAR(clear_module_state->__pyx_n_s_tz); - Py_CLEAR(clear_module_state->__pyx_n_s_unsubscribe); - Py_CLEAR(clear_module_state->__pyx_n_s_update); - Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); - Py_CLEAR(clear_module_state->__pyx_n_s_user); - Py_CLEAR(clear_module_state->__pyx_n_s_utc_datetime_epoch); - Py_CLEAR(clear_module_state->__pyx_n_s_utc_tz); - Py_CLEAR(clear_module_state->__pyx_n_s_utcfromtimestamp); - Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); - Py_CLEAR(clear_module_state->__pyx_n_s_v); - Py_CLEAR(clear_module_state->__pyx_n_s_v_2); - Py_CLEAR(clear_module_state->__pyx_n_s_vg_id); - Py_CLEAR(clear_module_state->__pyx_n_s_zip); - Py_CLEAR(clear_module_state->__pyx_int_0); - Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_int_86400); - Py_CLEAR(clear_module_state->__pyx_int_17084266); - Py_CLEAR(clear_module_state->__pyx_int_126557407); - Py_CLEAR(clear_module_state->__pyx_int_199624353); - Py_CLEAR(clear_module_state->__pyx_codeobj_); - Py_CLEAR(clear_module_state->__pyx_tuple__42); - Py_CLEAR(clear_module_state->__pyx_tuple__43); - Py_CLEAR(clear_module_state->__pyx_tuple__45); - Py_CLEAR(clear_module_state->__pyx_tuple__62); - Py_CLEAR(clear_module_state->__pyx_tuple__65); - Py_CLEAR(clear_module_state->__pyx_tuple__66); - Py_CLEAR(clear_module_state->__pyx_tuple__67); - Py_CLEAR(clear_module_state->__pyx_tuple__68); - Py_CLEAR(clear_module_state->__pyx_tuple__69); - Py_CLEAR(clear_module_state->__pyx_tuple__70); - Py_CLEAR(clear_module_state->__pyx_tuple__71); - Py_CLEAR(clear_module_state->__pyx_tuple__72); - Py_CLEAR(clear_module_state->__pyx_tuple__73); - Py_CLEAR(clear_module_state->__pyx_tuple__74); - Py_CLEAR(clear_module_state->__pyx_tuple__75); - Py_CLEAR(clear_module_state->__pyx_tuple__76); - Py_CLEAR(clear_module_state->__pyx_tuple__77); - Py_CLEAR(clear_module_state->__pyx_tuple__78); - Py_CLEAR(clear_module_state->__pyx_tuple__79); - Py_CLEAR(clear_module_state->__pyx_tuple__80); - Py_CLEAR(clear_module_state->__pyx_tuple__81); - Py_CLEAR(clear_module_state->__pyx_tuple__82); - Py_CLEAR(clear_module_state->__pyx_tuple__83); - Py_CLEAR(clear_module_state->__pyx_tuple__84); - Py_CLEAR(clear_module_state->__pyx_tuple__85); - Py_CLEAR(clear_module_state->__pyx_tuple__86); - Py_CLEAR(clear_module_state->__pyx_tuple__87); - Py_CLEAR(clear_module_state->__pyx_tuple__88); - Py_CLEAR(clear_module_state->__pyx_tuple__89); - Py_CLEAR(clear_module_state->__pyx_tuple__90); - Py_CLEAR(clear_module_state->__pyx_tuple__91); - Py_CLEAR(clear_module_state->__pyx_tuple__92); - Py_CLEAR(clear_module_state->__pyx_tuple__93); - Py_CLEAR(clear_module_state->__pyx_tuple__94); - Py_CLEAR(clear_module_state->__pyx_tuple__95); - Py_CLEAR(clear_module_state->__pyx_tuple__96); - Py_CLEAR(clear_module_state->__pyx_tuple__97); - Py_CLEAR(clear_module_state->__pyx_tuple__98); - Py_CLEAR(clear_module_state->__pyx_tuple__99); - Py_CLEAR(clear_module_state->__pyx_codeobj__2); - Py_CLEAR(clear_module_state->__pyx_codeobj__3); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__5); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__7); - Py_CLEAR(clear_module_state->__pyx_codeobj__8); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_tuple__100); - Py_CLEAR(clear_module_state->__pyx_codeobj__10); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__16); - Py_CLEAR(clear_module_state->__pyx_codeobj__17); - Py_CLEAR(clear_module_state->__pyx_codeobj__18); - Py_CLEAR(clear_module_state->__pyx_codeobj__20); - Py_CLEAR(clear_module_state->__pyx_codeobj__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__22); - Py_CLEAR(clear_module_state->__pyx_codeobj__23); - Py_CLEAR(clear_module_state->__pyx_codeobj__24); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); - Py_CLEAR(clear_module_state->__pyx_codeobj__26); - Py_CLEAR(clear_module_state->__pyx_codeobj__27); - Py_CLEAR(clear_module_state->__pyx_codeobj__28); - Py_CLEAR(clear_module_state->__pyx_codeobj__29); - Py_CLEAR(clear_module_state->__pyx_codeobj__30); - Py_CLEAR(clear_module_state->__pyx_codeobj__31); - Py_CLEAR(clear_module_state->__pyx_codeobj__32); - Py_CLEAR(clear_module_state->__pyx_codeobj__33); - Py_CLEAR(clear_module_state->__pyx_codeobj__34); - Py_CLEAR(clear_module_state->__pyx_codeobj__35); - Py_CLEAR(clear_module_state->__pyx_codeobj__36); - Py_CLEAR(clear_module_state->__pyx_codeobj__37); - Py_CLEAR(clear_module_state->__pyx_codeobj__38); - Py_CLEAR(clear_module_state->__pyx_codeobj__39); - Py_CLEAR(clear_module_state->__pyx_codeobj__40); - Py_CLEAR(clear_module_state->__pyx_codeobj__41); - Py_CLEAR(clear_module_state->__pyx_codeobj__44); - Py_CLEAR(clear_module_state->__pyx_codeobj__46); - Py_CLEAR(clear_module_state->__pyx_codeobj__47); - Py_CLEAR(clear_module_state->__pyx_codeobj__48); - Py_CLEAR(clear_module_state->__pyx_codeobj__49); - Py_CLEAR(clear_module_state->__pyx_codeobj__50); - Py_CLEAR(clear_module_state->__pyx_codeobj__51); - Py_CLEAR(clear_module_state->__pyx_codeobj__52); - Py_CLEAR(clear_module_state->__pyx_codeobj__53); - Py_CLEAR(clear_module_state->__pyx_codeobj__54); - Py_CLEAR(clear_module_state->__pyx_codeobj__55); - Py_CLEAR(clear_module_state->__pyx_codeobj__56); - Py_CLEAR(clear_module_state->__pyx_codeobj__57); - Py_CLEAR(clear_module_state->__pyx_codeobj__58); - Py_CLEAR(clear_module_state->__pyx_codeobj__59); - Py_CLEAR(clear_module_state->__pyx_codeobj__60); - Py_CLEAR(clear_module_state->__pyx_codeobj__61); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif - Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosConnection); - Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosConnection); - Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosField); - Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosField); - Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosResult); - Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosResult); - Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosCursor); - Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosCursor); - Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosTopicAssignment); - Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosTopicAssignment); - Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects_TaosConsumer); - Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects_TaosConsumer); - Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter); - Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter); - Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter); - Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter); - Py_VISIT(traverse_module_state->__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__); - Py_VISIT(traverse_module_state->__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__); - Py_VISIT(traverse_module_state->__pyx_n_s_CONVERT_FUNC); - Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionError); - Py_VISIT(traverse_module_state->__pyx_kp_u_Cursor_is_not_connected); - Py_VISIT(traverse_module_state->__pyx_n_s_DatabaseError); - Py_VISIT(traverse_module_state->__pyx_n_u_DictRow); - Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); - Py_VISIT(traverse_module_state->__pyx_n_s_InternalError); - Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_use_of_fetch_iterator); - Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_use_of_fetchall); - Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_use_of_rows_iter); - Py_VISIT(traverse_module_state->__pyx_n_s_OSError); - Py_VISIT(traverse_module_state->__pyx_n_s_OperationalError); - Py_VISIT(traverse_module_state->__pyx_n_s_Optional); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_int); - Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); - Py_VISIT(traverse_module_state->__pyx_n_s_ProgrammingError); - Py_VISIT(traverse_module_state->__pyx_n_s_SIZED_TYPE); - Py_VISIT(traverse_module_state->__pyx_n_s_StatementError); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection___reduce_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection___setstate_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection__check_conn_error); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection__init_conn); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection__init_options); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_clear_result_set); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_close); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_commit); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_execute); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_get_table_vgroup); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_load_table_info); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_query); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_query_a); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_rollback); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_select_db); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConnection_subscribe); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer___reduce_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer___setstate_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_commit); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_committed); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_db_name); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_topic_assignmen); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_topic_name); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_vgroup_id); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_get_vgroup_offset); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_offset_commit); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_offset_seek); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_poll); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_position); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_result_commit); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_subscribe); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosConsumer_unsubscribe); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor___iter); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor___reduce_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor___setstate_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor__reset_result); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor_close); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor_execute); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor_fetchall); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosCursor_fetchone); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosField); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosField___reduce_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosField___setstate_cython); - Py_VISIT(traverse_module_state->__pyx_kp_u_TaosField_name); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult___reduce_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult___setstate_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult__check_result_error); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult__fetch_block); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_blocks_iter); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_fetch_all); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_fetch_all_into_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_fetch_block); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_fetch_rows_a); - Py_VISIT(traverse_module_state->__pyx_kp_u_TaosResult_res); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_rows_iter); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosResult_taos_fetch_raw_block); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosTopicAssignment); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosTopicAssignment___reduce_cyt); - Py_VISIT(traverse_module_state->__pyx_n_s_TaosTopicAssignment___setstate_c); - Py_VISIT(traverse_module_state->__pyx_n_s_TmqError); - Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); - Py_VISIT(traverse_module_state->__pyx_n_s_UNSIZED_TYPE); - Py_VISIT(traverse_module_state->__pyx_n_u_UTC); - Py_VISIT(traverse_module_state->__pyx_n_s__101); - Py_VISIT(traverse_module_state->__pyx_kp_u__12); - Py_VISIT(traverse_module_state->__pyx_kp_u__19); - Py_VISIT(traverse_module_state->__pyx_kp_u__63); - Py_VISIT(traverse_module_state->__pyx_n_s__64); - Py_VISIT(traverse_module_state->__pyx_n_s_affected_rows); - Py_VISIT(traverse_module_state->__pyx_n_s_args); - Py_VISIT(traverse_module_state->__pyx_n_s_asdict); - Py_VISIT(traverse_module_state->__pyx_n_s_assignment); - Py_VISIT(traverse_module_state->__pyx_n_s_assignment_ptr); - Py_VISIT(traverse_module_state->__pyx_n_s_astimezone); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_b); - Py_VISIT(traverse_module_state->__pyx_n_s_begin); - Py_VISIT(traverse_module_state->__pyx_n_s_block); - Py_VISIT(traverse_module_state->__pyx_n_s_blocks); - Py_VISIT(traverse_module_state->__pyx_n_s_blocks_iter); - Py_VISIT(traverse_module_state->__pyx_n_s_bytes); - Py_VISIT(traverse_module_state->__pyx_kp_u_bytes_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_callback); - Py_VISIT(traverse_module_state->__pyx_n_s_callback_2); - Py_VISIT(traverse_module_state->__pyx_n_s_check_conn_error); - Py_VISIT(traverse_module_state->__pyx_n_s_check_result_error); - Py_VISIT(traverse_module_state->__pyx_n_s_clear_result_set); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_code); - Py_VISIT(traverse_module_state->__pyx_n_s_collections); - Py_VISIT(traverse_module_state->__pyx_n_s_commit); - Py_VISIT(traverse_module_state->__pyx_n_s_committed); - Py_VISIT(traverse_module_state->__pyx_n_s_config); - Py_VISIT(traverse_module_state->__pyx_n_s_configs); - Py_VISIT(traverse_module_state->__pyx_n_s_connection); - Py_VISIT(traverse_module_state->__pyx_n_s_current_offset); - Py_VISIT(traverse_module_state->__pyx_n_u_d); - Py_VISIT(traverse_module_state->__pyx_n_s_data); - Py_VISIT(traverse_module_state->__pyx_n_s_database); - Py_VISIT(traverse_module_state->__pyx_n_s_database_2); - Py_VISIT(traverse_module_state->__pyx_n_s_datetime); - Py_VISIT(traverse_module_state->__pyx_n_s_datetime_epoch); - Py_VISIT(traverse_module_state->__pyx_n_s_db); - Py_VISIT(traverse_module_state->__pyx_n_s_db_2); - Py_VISIT(traverse_module_state->__pyx_n_s_decode); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); - Py_VISIT(traverse_module_state->__pyx_n_s_dict_row_cls); - Py_VISIT(traverse_module_state->__pyx_kp_s_dict_str_str); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_dt); - Py_VISIT(traverse_module_state->__pyx_n_s_dt_epoch); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_encode); - Py_VISIT(traverse_module_state->__pyx_n_s_end); - Py_VISIT(traverse_module_state->__pyx_n_s_errno); - Py_VISIT(traverse_module_state->__pyx_n_s_errstr); - Py_VISIT(traverse_module_state->__pyx_n_s_execute); - Py_VISIT(traverse_module_state->__pyx_n_s_f); - Py_VISIT(traverse_module_state->__pyx_n_s_fetch_all); - Py_VISIT(traverse_module_state->__pyx_n_s_fetch_all_into_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_fetch_block); - Py_VISIT(traverse_module_state->__pyx_n_s_fetch_block_2); - Py_VISIT(traverse_module_state->__pyx_n_s_fetch_rows_a); - Py_VISIT(traverse_module_state->__pyx_n_s_fetchall); - Py_VISIT(traverse_module_state->__pyx_n_s_fetchone); - Py_VISIT(traverse_module_state->__pyx_n_s_field); - Py_VISIT(traverse_module_state->__pyx_n_s_field_names); - Py_VISIT(traverse_module_state->__pyx_n_s_fields); - Py_VISIT(traverse_module_state->__pyx_n_s_fromtimestamp); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_get_db_name); - Py_VISIT(traverse_module_state->__pyx_n_s_get_table_vgroup_id); - Py_VISIT(traverse_module_state->__pyx_n_s_get_topic_assignment); - Py_VISIT(traverse_module_state->__pyx_n_s_get_topic_name); - Py_VISIT(traverse_module_state->__pyx_n_s_get_vgroup_id); - Py_VISIT(traverse_module_state->__pyx_n_s_get_vgroup_offset); - Py_VISIT(traverse_module_state->__pyx_n_s_getstate); - Py_VISIT(traverse_module_state->__pyx_n_s_host); - Py_VISIT(traverse_module_state->__pyx_n_s_i); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_init_conn); - Py_VISIT(traverse_module_state->__pyx_n_s_init_options); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_int); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_s_is_null); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_n_s_items); - Py_VISIT(traverse_module_state->__pyx_n_s_iter); - Py_VISIT(traverse_module_state->__pyx_n_s_k); - Py_VISIT(traverse_module_state->__pyx_n_s_k_2); - Py_VISIT(traverse_module_state->__pyx_n_s_list); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_str); - Py_VISIT(traverse_module_state->__pyx_n_s_load_table_info); - Py_VISIT(traverse_module_state->__pyx_n_s_localize); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_map); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_name_2); - Py_VISIT(traverse_module_state->__pyx_n_s_namedtuple); - Py_VISIT(traverse_module_state->__pyx_n_s_new); - Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); - Py_VISIT(traverse_module_state->__pyx_n_s_num_of_assignment); - Py_VISIT(traverse_module_state->__pyx_n_s_num_of_rows); - Py_VISIT(traverse_module_state->__pyx_n_s_offset); - Py_VISIT(traverse_module_state->__pyx_n_s_offset_commit); - Py_VISIT(traverse_module_state->__pyx_n_s_offset_seek); - Py_VISIT(traverse_module_state->__pyx_n_s_offsets); - Py_VISIT(traverse_module_state->__pyx_n_s_params); - Py_VISIT(traverse_module_state->__pyx_n_s_password); - Py_VISIT(traverse_module_state->__pyx_n_s_pblock); - Py_VISIT(traverse_module_state->__pyx_n_s_pickle); - Py_VISIT(traverse_module_state->__pyx_n_s_poll); - Py_VISIT(traverse_module_state->__pyx_n_s_port); - Py_VISIT(traverse_module_state->__pyx_n_s_pos); - Py_VISIT(traverse_module_state->__pyx_n_s_position); - Py_VISIT(traverse_module_state->__pyx_n_s_print); - Py_VISIT(traverse_module_state->__pyx_n_s_priv_datetime_epoch); - Py_VISIT(traverse_module_state->__pyx_n_s_priv_tz); - Py_VISIT(traverse_module_state->__pyx_n_s_pytz); - Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); - Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); - Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); - Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); - Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); - Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_TaosCursor); - Py_VISIT(traverse_module_state->__pyx_n_s_query); - Py_VISIT(traverse_module_state->__pyx_n_s_query_a); - Py_VISIT(traverse_module_state->__pyx_n_s_r); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_reduce); - Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); - Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); - Py_VISIT(traverse_module_state->__pyx_n_s_req_id); - Py_VISIT(traverse_module_state->__pyx_n_s_res); - Py_VISIT(traverse_module_state->__pyx_n_s_reset_result); - Py_VISIT(traverse_module_state->__pyx_n_s_result_commit); - Py_VISIT(traverse_module_state->__pyx_n_s_rollback); - Py_VISIT(traverse_module_state->__pyx_n_u_root); - Py_VISIT(traverse_module_state->__pyx_n_s_row); - Py_VISIT(traverse_module_state->__pyx_n_s_row_count); - Py_VISIT(traverse_module_state->__pyx_n_s_rows_iter); - Py_VISIT(traverse_module_state->__pyx_n_s_seconds); - Py_VISIT(traverse_module_state->__pyx_kp_u_select_database_error); - Py_VISIT(traverse_module_state->__pyx_n_s_select_db); - Py_VISIT(traverse_module_state->__pyx_n_s_self); - Py_VISIT(traverse_module_state->__pyx_n_s_send); - Py_VISIT(traverse_module_state->__pyx_n_s_set_tz); - Py_VISIT(traverse_module_state->__pyx_kp_u_set_up_tmq_config_failed); - Py_VISIT(traverse_module_state->__pyx_kp_u_set_up_tmq_list_failed); - Py_VISIT(traverse_module_state->__pyx_n_s_setstate); - Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); - Py_VISIT(traverse_module_state->__pyx_kp_u_setup_tmq_failed); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_sql); - Py_VISIT(traverse_module_state->__pyx_n_s_sql_2); - Py_VISIT(traverse_module_state->__pyx_n_s_state); - Py_VISIT(traverse_module_state->__pyx_n_s_str); - Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); - Py_VISIT(traverse_module_state->__pyx_n_s_subscribe); - Py_VISIT(traverse_module_state->__pyx_n_s_table); - Py_VISIT(traverse_module_state->__pyx_n_s_table_2); - Py_VISIT(traverse_module_state->__pyx_n_s_tables); - Py_VISIT(traverse_module_state->__pyx_n_s_tables_2); - Py_VISIT(traverse_module_state->__pyx_n_s_taos__cinterface); - Py_VISIT(traverse_module_state->__pyx_n_s_taos__objects); - Py_VISIT(traverse_module_state->__pyx_kp_s_taos__objects_pyx); - Py_VISIT(traverse_module_state->__pyx_n_s_taos_error); - Py_VISIT(traverse_module_state->__pyx_n_s_taos_fetch_raw_block_a); - Py_VISIT(traverse_module_state->__pyx_n_s_taos_res); - Py_VISIT(traverse_module_state->__pyx_n_s_taos_row); - Py_VISIT(traverse_module_state->__pyx_n_u_taosdata); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_throw); - Py_VISIT(traverse_module_state->__pyx_n_s_timedelta); - Py_VISIT(traverse_module_state->__pyx_n_s_timeout); - Py_VISIT(traverse_module_state->__pyx_n_s_timezone); - Py_VISIT(traverse_module_state->__pyx_n_s_tmq_conf); - Py_VISIT(traverse_module_state->__pyx_kp_u_tmq_conf_res); - Py_VISIT(traverse_module_state->__pyx_n_s_tmq_conf_res_2); - Py_VISIT(traverse_module_state->__pyx_n_s_tmq_errno); - Py_VISIT(traverse_module_state->__pyx_n_s_tmq_list); - Py_VISIT(traverse_module_state->__pyx_n_s_topic); - Py_VISIT(traverse_module_state->__pyx_n_s_topic_2); - Py_VISIT(traverse_module_state->__pyx_n_s_topic_assignments); - Py_VISIT(traverse_module_state->__pyx_n_s_topics); - Py_VISIT(traverse_module_state->__pyx_n_s_tp); - Py_VISIT(traverse_module_state->__pyx_n_s_tp_2); - Py_VISIT(traverse_module_state->__pyx_n_s_tta); - Py_VISIT(traverse_module_state->__pyx_n_s_type); - Py_VISIT(traverse_module_state->__pyx_kp_u_type_2); - Py_VISIT(traverse_module_state->__pyx_n_s_type_3); - Py_VISIT(traverse_module_state->__pyx_n_s_typing); - Py_VISIT(traverse_module_state->__pyx_n_s_tz); - Py_VISIT(traverse_module_state->__pyx_n_s_unsubscribe); - Py_VISIT(traverse_module_state->__pyx_n_s_update); - Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); - Py_VISIT(traverse_module_state->__pyx_n_s_user); - Py_VISIT(traverse_module_state->__pyx_n_s_utc_datetime_epoch); - Py_VISIT(traverse_module_state->__pyx_n_s_utc_tz); - Py_VISIT(traverse_module_state->__pyx_n_s_utcfromtimestamp); - Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); - Py_VISIT(traverse_module_state->__pyx_n_s_v); - Py_VISIT(traverse_module_state->__pyx_n_s_v_2); - Py_VISIT(traverse_module_state->__pyx_n_s_vg_id); - Py_VISIT(traverse_module_state->__pyx_n_s_zip); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_int_86400); - Py_VISIT(traverse_module_state->__pyx_int_17084266); - Py_VISIT(traverse_module_state->__pyx_int_126557407); - Py_VISIT(traverse_module_state->__pyx_int_199624353); - Py_VISIT(traverse_module_state->__pyx_codeobj_); - Py_VISIT(traverse_module_state->__pyx_tuple__42); - Py_VISIT(traverse_module_state->__pyx_tuple__43); - Py_VISIT(traverse_module_state->__pyx_tuple__45); - Py_VISIT(traverse_module_state->__pyx_tuple__62); - Py_VISIT(traverse_module_state->__pyx_tuple__65); - Py_VISIT(traverse_module_state->__pyx_tuple__66); - Py_VISIT(traverse_module_state->__pyx_tuple__67); - Py_VISIT(traverse_module_state->__pyx_tuple__68); - Py_VISIT(traverse_module_state->__pyx_tuple__69); - Py_VISIT(traverse_module_state->__pyx_tuple__70); - Py_VISIT(traverse_module_state->__pyx_tuple__71); - Py_VISIT(traverse_module_state->__pyx_tuple__72); - Py_VISIT(traverse_module_state->__pyx_tuple__73); - Py_VISIT(traverse_module_state->__pyx_tuple__74); - Py_VISIT(traverse_module_state->__pyx_tuple__75); - Py_VISIT(traverse_module_state->__pyx_tuple__76); - Py_VISIT(traverse_module_state->__pyx_tuple__77); - Py_VISIT(traverse_module_state->__pyx_tuple__78); - Py_VISIT(traverse_module_state->__pyx_tuple__79); - Py_VISIT(traverse_module_state->__pyx_tuple__80); - Py_VISIT(traverse_module_state->__pyx_tuple__81); - Py_VISIT(traverse_module_state->__pyx_tuple__82); - Py_VISIT(traverse_module_state->__pyx_tuple__83); - Py_VISIT(traverse_module_state->__pyx_tuple__84); - Py_VISIT(traverse_module_state->__pyx_tuple__85); - Py_VISIT(traverse_module_state->__pyx_tuple__86); - Py_VISIT(traverse_module_state->__pyx_tuple__87); - Py_VISIT(traverse_module_state->__pyx_tuple__88); - Py_VISIT(traverse_module_state->__pyx_tuple__89); - Py_VISIT(traverse_module_state->__pyx_tuple__90); - Py_VISIT(traverse_module_state->__pyx_tuple__91); - Py_VISIT(traverse_module_state->__pyx_tuple__92); - Py_VISIT(traverse_module_state->__pyx_tuple__93); - Py_VISIT(traverse_module_state->__pyx_tuple__94); - Py_VISIT(traverse_module_state->__pyx_tuple__95); - Py_VISIT(traverse_module_state->__pyx_tuple__96); - Py_VISIT(traverse_module_state->__pyx_tuple__97); - Py_VISIT(traverse_module_state->__pyx_tuple__98); - Py_VISIT(traverse_module_state->__pyx_tuple__99); - Py_VISIT(traverse_module_state->__pyx_codeobj__2); - Py_VISIT(traverse_module_state->__pyx_codeobj__3); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__5); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__7); - Py_VISIT(traverse_module_state->__pyx_codeobj__8); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_tuple__100); - Py_VISIT(traverse_module_state->__pyx_codeobj__10); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__16); - Py_VISIT(traverse_module_state->__pyx_codeobj__17); - Py_VISIT(traverse_module_state->__pyx_codeobj__18); - Py_VISIT(traverse_module_state->__pyx_codeobj__20); - Py_VISIT(traverse_module_state->__pyx_codeobj__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__22); - Py_VISIT(traverse_module_state->__pyx_codeobj__23); - Py_VISIT(traverse_module_state->__pyx_codeobj__24); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); - Py_VISIT(traverse_module_state->__pyx_codeobj__26); - Py_VISIT(traverse_module_state->__pyx_codeobj__27); - Py_VISIT(traverse_module_state->__pyx_codeobj__28); - Py_VISIT(traverse_module_state->__pyx_codeobj__29); - Py_VISIT(traverse_module_state->__pyx_codeobj__30); - Py_VISIT(traverse_module_state->__pyx_codeobj__31); - Py_VISIT(traverse_module_state->__pyx_codeobj__32); - Py_VISIT(traverse_module_state->__pyx_codeobj__33); - Py_VISIT(traverse_module_state->__pyx_codeobj__34); - Py_VISIT(traverse_module_state->__pyx_codeobj__35); - Py_VISIT(traverse_module_state->__pyx_codeobj__36); - Py_VISIT(traverse_module_state->__pyx_codeobj__37); - Py_VISIT(traverse_module_state->__pyx_codeobj__38); - Py_VISIT(traverse_module_state->__pyx_codeobj__39); - Py_VISIT(traverse_module_state->__pyx_codeobj__40); - Py_VISIT(traverse_module_state->__pyx_codeobj__41); - Py_VISIT(traverse_module_state->__pyx_codeobj__44); - Py_VISIT(traverse_module_state->__pyx_codeobj__46); - Py_VISIT(traverse_module_state->__pyx_codeobj__47); - Py_VISIT(traverse_module_state->__pyx_codeobj__48); - Py_VISIT(traverse_module_state->__pyx_codeobj__49); - Py_VISIT(traverse_module_state->__pyx_codeobj__50); - Py_VISIT(traverse_module_state->__pyx_codeobj__51); - Py_VISIT(traverse_module_state->__pyx_codeobj__52); - Py_VISIT(traverse_module_state->__pyx_codeobj__53); - Py_VISIT(traverse_module_state->__pyx_codeobj__54); - Py_VISIT(traverse_module_state->__pyx_codeobj__55); - Py_VISIT(traverse_module_state->__pyx_codeobj__56); - Py_VISIT(traverse_module_state->__pyx_codeobj__57); - Py_VISIT(traverse_module_state->__pyx_codeobj__58); - Py_VISIT(traverse_module_state->__pyx_codeobj__59); - Py_VISIT(traverse_module_state->__pyx_codeobj__60); - Py_VISIT(traverse_module_state->__pyx_codeobj__61); - return 0; -} -#endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_type_4taos_8_objects_TaosConnection __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosConnection -#define __pyx_type_4taos_8_objects_TaosField __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosField -#define __pyx_type_4taos_8_objects_TaosResult __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosResult -#define __pyx_type_4taos_8_objects_TaosCursor __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosCursor -#define __pyx_type_4taos_8_objects_TaosTopicAssignment __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosTopicAssignment -#define __pyx_type_4taos_8_objects_TaosConsumer __pyx_mstate_global->__pyx_type_4taos_8_objects_TaosConsumer -#define __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter __pyx_mstate_global->__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter -#define __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter __pyx_mstate_global->__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter -#define __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__ __pyx_mstate_global->__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__ -#endif -#define __pyx_ptype_4taos_8_objects_TaosConnection __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosConnection -#define __pyx_ptype_4taos_8_objects_TaosField __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosField -#define __pyx_ptype_4taos_8_objects_TaosResult __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosResult -#define __pyx_ptype_4taos_8_objects_TaosCursor __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosCursor -#define __pyx_ptype_4taos_8_objects_TaosTopicAssignment __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosTopicAssignment -#define __pyx_ptype_4taos_8_objects_TaosConsumer __pyx_mstate_global->__pyx_ptype_4taos_8_objects_TaosConsumer -#define __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter __pyx_mstate_global->__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter -#define __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter __pyx_mstate_global->__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter -#define __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__ __pyx_mstate_global->__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__ -#define __pyx_n_s_CONVERT_FUNC __pyx_mstate_global->__pyx_n_s_CONVERT_FUNC -#define __pyx_n_s_ConnectionError __pyx_mstate_global->__pyx_n_s_ConnectionError -#define __pyx_kp_u_Cursor_is_not_connected __pyx_mstate_global->__pyx_kp_u_Cursor_is_not_connected -#define __pyx_n_s_DatabaseError __pyx_mstate_global->__pyx_n_s_DatabaseError -#define __pyx_n_u_DictRow __pyx_mstate_global->__pyx_n_u_DictRow -#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 -#define __pyx_n_s_InternalError __pyx_mstate_global->__pyx_n_s_InternalError -#define __pyx_kp_u_Invalid_use_of_fetch_iterator __pyx_mstate_global->__pyx_kp_u_Invalid_use_of_fetch_iterator -#define __pyx_kp_u_Invalid_use_of_fetchall __pyx_mstate_global->__pyx_kp_u_Invalid_use_of_fetchall -#define __pyx_kp_u_Invalid_use_of_rows_iter __pyx_mstate_global->__pyx_kp_u_Invalid_use_of_rows_iter -#define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError -#define __pyx_n_s_OperationalError __pyx_mstate_global->__pyx_n_s_OperationalError -#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional -#define __pyx_kp_s_Optional_int __pyx_mstate_global->__pyx_kp_s_Optional_int -#define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError -#define __pyx_n_s_ProgrammingError __pyx_mstate_global->__pyx_n_s_ProgrammingError -#define __pyx_n_s_SIZED_TYPE __pyx_mstate_global->__pyx_n_s_SIZED_TYPE -#define __pyx_n_s_StatementError __pyx_mstate_global->__pyx_n_s_StatementError -#define __pyx_n_s_TaosConnection __pyx_mstate_global->__pyx_n_s_TaosConnection -#define __pyx_n_s_TaosConnection___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosConnection___reduce_cython -#define __pyx_n_s_TaosConnection___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosConnection___setstate_cython -#define __pyx_n_s_TaosConnection__check_conn_error __pyx_mstate_global->__pyx_n_s_TaosConnection__check_conn_error -#define __pyx_n_s_TaosConnection__init_conn __pyx_mstate_global->__pyx_n_s_TaosConnection__init_conn -#define __pyx_n_s_TaosConnection__init_options __pyx_mstate_global->__pyx_n_s_TaosConnection__init_options -#define __pyx_n_s_TaosConnection_clear_result_set __pyx_mstate_global->__pyx_n_s_TaosConnection_clear_result_set -#define __pyx_n_s_TaosConnection_close __pyx_mstate_global->__pyx_n_s_TaosConnection_close -#define __pyx_n_s_TaosConnection_commit __pyx_mstate_global->__pyx_n_s_TaosConnection_commit -#define __pyx_n_s_TaosConnection_execute __pyx_mstate_global->__pyx_n_s_TaosConnection_execute -#define __pyx_n_s_TaosConnection_get_table_vgroup __pyx_mstate_global->__pyx_n_s_TaosConnection_get_table_vgroup -#define __pyx_n_s_TaosConnection_load_table_info __pyx_mstate_global->__pyx_n_s_TaosConnection_load_table_info -#define __pyx_n_s_TaosConnection_query __pyx_mstate_global->__pyx_n_s_TaosConnection_query -#define __pyx_n_s_TaosConnection_query_a __pyx_mstate_global->__pyx_n_s_TaosConnection_query_a -#define __pyx_n_s_TaosConnection_rollback __pyx_mstate_global->__pyx_n_s_TaosConnection_rollback -#define __pyx_n_s_TaosConnection_select_db __pyx_mstate_global->__pyx_n_s_TaosConnection_select_db -#define __pyx_n_s_TaosConnection_subscribe __pyx_mstate_global->__pyx_n_s_TaosConnection_subscribe -#define __pyx_n_s_TaosConsumer __pyx_mstate_global->__pyx_n_s_TaosConsumer -#define __pyx_n_s_TaosConsumer___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosConsumer___reduce_cython -#define __pyx_n_s_TaosConsumer___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosConsumer___setstate_cython -#define __pyx_n_s_TaosConsumer_commit __pyx_mstate_global->__pyx_n_s_TaosConsumer_commit -#define __pyx_n_s_TaosConsumer_committed __pyx_mstate_global->__pyx_n_s_TaosConsumer_committed -#define __pyx_n_s_TaosConsumer_get_db_name __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_db_name -#define __pyx_n_s_TaosConsumer_get_topic_assignmen __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_topic_assignmen -#define __pyx_n_s_TaosConsumer_get_topic_name __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_topic_name -#define __pyx_n_s_TaosConsumer_get_vgroup_id __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_vgroup_id -#define __pyx_n_s_TaosConsumer_get_vgroup_offset __pyx_mstate_global->__pyx_n_s_TaosConsumer_get_vgroup_offset -#define __pyx_n_s_TaosConsumer_offset_commit __pyx_mstate_global->__pyx_n_s_TaosConsumer_offset_commit -#define __pyx_n_s_TaosConsumer_offset_seek __pyx_mstate_global->__pyx_n_s_TaosConsumer_offset_seek -#define __pyx_n_s_TaosConsumer_poll __pyx_mstate_global->__pyx_n_s_TaosConsumer_poll -#define __pyx_n_s_TaosConsumer_position __pyx_mstate_global->__pyx_n_s_TaosConsumer_position -#define __pyx_n_s_TaosConsumer_result_commit __pyx_mstate_global->__pyx_n_s_TaosConsumer_result_commit -#define __pyx_n_s_TaosConsumer_subscribe __pyx_mstate_global->__pyx_n_s_TaosConsumer_subscribe -#define __pyx_n_s_TaosConsumer_unsubscribe __pyx_mstate_global->__pyx_n_s_TaosConsumer_unsubscribe -#define __pyx_n_s_TaosCursor __pyx_mstate_global->__pyx_n_s_TaosCursor -#define __pyx_n_s_TaosCursor___iter __pyx_mstate_global->__pyx_n_s_TaosCursor___iter -#define __pyx_n_s_TaosCursor___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosCursor___reduce_cython -#define __pyx_n_s_TaosCursor___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosCursor___setstate_cython -#define __pyx_n_s_TaosCursor__reset_result __pyx_mstate_global->__pyx_n_s_TaosCursor__reset_result -#define __pyx_n_s_TaosCursor_close __pyx_mstate_global->__pyx_n_s_TaosCursor_close -#define __pyx_n_s_TaosCursor_execute __pyx_mstate_global->__pyx_n_s_TaosCursor_execute -#define __pyx_n_s_TaosCursor_fetchall __pyx_mstate_global->__pyx_n_s_TaosCursor_fetchall -#define __pyx_n_s_TaosCursor_fetchone __pyx_mstate_global->__pyx_n_s_TaosCursor_fetchone -#define __pyx_n_s_TaosField __pyx_mstate_global->__pyx_n_s_TaosField -#define __pyx_n_s_TaosField___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosField___reduce_cython -#define __pyx_n_s_TaosField___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosField___setstate_cython -#define __pyx_kp_u_TaosField_name __pyx_mstate_global->__pyx_kp_u_TaosField_name -#define __pyx_n_s_TaosResult __pyx_mstate_global->__pyx_n_s_TaosResult -#define __pyx_n_s_TaosResult___reduce_cython __pyx_mstate_global->__pyx_n_s_TaosResult___reduce_cython -#define __pyx_n_s_TaosResult___setstate_cython __pyx_mstate_global->__pyx_n_s_TaosResult___setstate_cython -#define __pyx_n_s_TaosResult__check_result_error __pyx_mstate_global->__pyx_n_s_TaosResult__check_result_error -#define __pyx_n_s_TaosResult__fetch_block __pyx_mstate_global->__pyx_n_s_TaosResult__fetch_block -#define __pyx_n_s_TaosResult_blocks_iter __pyx_mstate_global->__pyx_n_s_TaosResult_blocks_iter -#define __pyx_n_s_TaosResult_fetch_all __pyx_mstate_global->__pyx_n_s_TaosResult_fetch_all -#define __pyx_n_s_TaosResult_fetch_all_into_dict __pyx_mstate_global->__pyx_n_s_TaosResult_fetch_all_into_dict -#define __pyx_n_s_TaosResult_fetch_block __pyx_mstate_global->__pyx_n_s_TaosResult_fetch_block -#define __pyx_n_s_TaosResult_fetch_rows_a __pyx_mstate_global->__pyx_n_s_TaosResult_fetch_rows_a -#define __pyx_kp_u_TaosResult_res __pyx_mstate_global->__pyx_kp_u_TaosResult_res -#define __pyx_n_s_TaosResult_rows_iter __pyx_mstate_global->__pyx_n_s_TaosResult_rows_iter -#define __pyx_n_s_TaosResult_taos_fetch_raw_block __pyx_mstate_global->__pyx_n_s_TaosResult_taos_fetch_raw_block -#define __pyx_n_s_TaosTopicAssignment __pyx_mstate_global->__pyx_n_s_TaosTopicAssignment -#define __pyx_n_s_TaosTopicAssignment___reduce_cyt __pyx_mstate_global->__pyx_n_s_TaosTopicAssignment___reduce_cyt -#define __pyx_n_s_TaosTopicAssignment___setstate_c __pyx_mstate_global->__pyx_n_s_TaosTopicAssignment___setstate_c -#define __pyx_n_s_TmqError __pyx_mstate_global->__pyx_n_s_TmqError -#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError -#define __pyx_n_s_UNSIZED_TYPE __pyx_mstate_global->__pyx_n_s_UNSIZED_TYPE -#define __pyx_n_u_UTC __pyx_mstate_global->__pyx_n_u_UTC -#define __pyx_n_s__101 __pyx_mstate_global->__pyx_n_s__101 -#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 -#define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19 -#define __pyx_kp_u__63 __pyx_mstate_global->__pyx_kp_u__63 -#define __pyx_n_s__64 __pyx_mstate_global->__pyx_n_s__64 -#define __pyx_n_s_affected_rows __pyx_mstate_global->__pyx_n_s_affected_rows -#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args -#define __pyx_n_s_asdict __pyx_mstate_global->__pyx_n_s_asdict -#define __pyx_n_s_assignment __pyx_mstate_global->__pyx_n_s_assignment -#define __pyx_n_s_assignment_ptr __pyx_mstate_global->__pyx_n_s_assignment_ptr -#define __pyx_n_s_astimezone __pyx_mstate_global->__pyx_n_s_astimezone -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b -#define __pyx_n_s_begin __pyx_mstate_global->__pyx_n_s_begin -#define __pyx_n_s_block __pyx_mstate_global->__pyx_n_s_block -#define __pyx_n_s_blocks __pyx_mstate_global->__pyx_n_s_blocks -#define __pyx_n_s_blocks_iter __pyx_mstate_global->__pyx_n_s_blocks_iter -#define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes -#define __pyx_kp_u_bytes_2 __pyx_mstate_global->__pyx_kp_u_bytes_2 -#define __pyx_kp_u_callback __pyx_mstate_global->__pyx_kp_u_callback -#define __pyx_n_s_callback_2 __pyx_mstate_global->__pyx_n_s_callback_2 -#define __pyx_n_s_check_conn_error __pyx_mstate_global->__pyx_n_s_check_conn_error -#define __pyx_n_s_check_result_error __pyx_mstate_global->__pyx_n_s_check_result_error -#define __pyx_n_s_clear_result_set __pyx_mstate_global->__pyx_n_s_clear_result_set -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_code __pyx_mstate_global->__pyx_n_s_code -#define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections -#define __pyx_n_s_commit __pyx_mstate_global->__pyx_n_s_commit -#define __pyx_n_s_committed __pyx_mstate_global->__pyx_n_s_committed -#define __pyx_n_s_config __pyx_mstate_global->__pyx_n_s_config -#define __pyx_n_s_configs __pyx_mstate_global->__pyx_n_s_configs -#define __pyx_n_s_connection __pyx_mstate_global->__pyx_n_s_connection -#define __pyx_n_s_current_offset __pyx_mstate_global->__pyx_n_s_current_offset -#define __pyx_n_u_d __pyx_mstate_global->__pyx_n_u_d -#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data -#define __pyx_n_s_database __pyx_mstate_global->__pyx_n_s_database -#define __pyx_n_s_database_2 __pyx_mstate_global->__pyx_n_s_database_2 -#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime -#define __pyx_n_s_datetime_epoch __pyx_mstate_global->__pyx_n_s_datetime_epoch -#define __pyx_n_s_db __pyx_mstate_global->__pyx_n_s_db -#define __pyx_n_s_db_2 __pyx_mstate_global->__pyx_n_s_db_2 -#define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 -#define __pyx_n_s_dict_row_cls __pyx_mstate_global->__pyx_n_s_dict_row_cls -#define __pyx_kp_s_dict_str_str __pyx_mstate_global->__pyx_kp_s_dict_str_str -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_dt __pyx_mstate_global->__pyx_n_s_dt -#define __pyx_n_s_dt_epoch __pyx_mstate_global->__pyx_n_s_dt_epoch -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode -#define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end -#define __pyx_n_s_errno __pyx_mstate_global->__pyx_n_s_errno -#define __pyx_n_s_errstr __pyx_mstate_global->__pyx_n_s_errstr -#define __pyx_n_s_execute __pyx_mstate_global->__pyx_n_s_execute -#define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f -#define __pyx_n_s_fetch_all __pyx_mstate_global->__pyx_n_s_fetch_all -#define __pyx_n_s_fetch_all_into_dict __pyx_mstate_global->__pyx_n_s_fetch_all_into_dict -#define __pyx_n_s_fetch_block __pyx_mstate_global->__pyx_n_s_fetch_block -#define __pyx_n_s_fetch_block_2 __pyx_mstate_global->__pyx_n_s_fetch_block_2 -#define __pyx_n_s_fetch_rows_a __pyx_mstate_global->__pyx_n_s_fetch_rows_a -#define __pyx_n_s_fetchall __pyx_mstate_global->__pyx_n_s_fetchall -#define __pyx_n_s_fetchone __pyx_mstate_global->__pyx_n_s_fetchone -#define __pyx_n_s_field __pyx_mstate_global->__pyx_n_s_field -#define __pyx_n_s_field_names __pyx_mstate_global->__pyx_n_s_field_names -#define __pyx_n_s_fields __pyx_mstate_global->__pyx_n_s_fields -#define __pyx_n_s_fromtimestamp __pyx_mstate_global->__pyx_n_s_fromtimestamp -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_get_db_name __pyx_mstate_global->__pyx_n_s_get_db_name -#define __pyx_n_s_get_table_vgroup_id __pyx_mstate_global->__pyx_n_s_get_table_vgroup_id -#define __pyx_n_s_get_topic_assignment __pyx_mstate_global->__pyx_n_s_get_topic_assignment -#define __pyx_n_s_get_topic_name __pyx_mstate_global->__pyx_n_s_get_topic_name -#define __pyx_n_s_get_vgroup_id __pyx_mstate_global->__pyx_n_s_get_vgroup_id -#define __pyx_n_s_get_vgroup_offset __pyx_mstate_global->__pyx_n_s_get_vgroup_offset -#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate -#define __pyx_n_s_host __pyx_mstate_global->__pyx_n_s_host -#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_init_conn __pyx_mstate_global->__pyx_n_s_init_conn -#define __pyx_n_s_init_options __pyx_mstate_global->__pyx_n_s_init_options -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_is_null __pyx_mstate_global->__pyx_n_s_is_null -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items -#define __pyx_n_s_iter __pyx_mstate_global->__pyx_n_s_iter -#define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k -#define __pyx_n_s_k_2 __pyx_mstate_global->__pyx_n_s_k_2 -#define __pyx_n_s_list __pyx_mstate_global->__pyx_n_s_list -#define __pyx_kp_s_list_str __pyx_mstate_global->__pyx_kp_s_list_str -#define __pyx_n_s_load_table_info __pyx_mstate_global->__pyx_n_s_load_table_info -#define __pyx_n_s_localize __pyx_mstate_global->__pyx_n_s_localize -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 -#define __pyx_n_s_namedtuple __pyx_mstate_global->__pyx_n_s_namedtuple -#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new -#define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non -#define __pyx_n_s_num_of_assignment __pyx_mstate_global->__pyx_n_s_num_of_assignment -#define __pyx_n_s_num_of_rows __pyx_mstate_global->__pyx_n_s_num_of_rows -#define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset -#define __pyx_n_s_offset_commit __pyx_mstate_global->__pyx_n_s_offset_commit -#define __pyx_n_s_offset_seek __pyx_mstate_global->__pyx_n_s_offset_seek -#define __pyx_n_s_offsets __pyx_mstate_global->__pyx_n_s_offsets -#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params -#define __pyx_n_s_password __pyx_mstate_global->__pyx_n_s_password -#define __pyx_n_s_pblock __pyx_mstate_global->__pyx_n_s_pblock -#define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle -#define __pyx_n_s_poll __pyx_mstate_global->__pyx_n_s_poll -#define __pyx_n_s_port __pyx_mstate_global->__pyx_n_s_port -#define __pyx_n_s_pos __pyx_mstate_global->__pyx_n_s_pos -#define __pyx_n_s_position __pyx_mstate_global->__pyx_n_s_position -#define __pyx_n_s_print __pyx_mstate_global->__pyx_n_s_print -#define __pyx_n_s_priv_datetime_epoch __pyx_mstate_global->__pyx_n_s_priv_datetime_epoch -#define __pyx_n_s_priv_tz __pyx_mstate_global->__pyx_n_s_priv_tz -#define __pyx_n_s_pytz __pyx_mstate_global->__pyx_n_s_pytz -#define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError -#define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum -#define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result -#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state -#define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type -#define __pyx_n_s_pyx_unpickle_TaosCursor __pyx_mstate_global->__pyx_n_s_pyx_unpickle_TaosCursor -#define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query -#define __pyx_n_s_query_a __pyx_mstate_global->__pyx_n_s_query_a -#define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce -#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython -#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex -#define __pyx_n_s_req_id __pyx_mstate_global->__pyx_n_s_req_id -#define __pyx_n_s_res __pyx_mstate_global->__pyx_n_s_res -#define __pyx_n_s_reset_result __pyx_mstate_global->__pyx_n_s_reset_result -#define __pyx_n_s_result_commit __pyx_mstate_global->__pyx_n_s_result_commit -#define __pyx_n_s_rollback __pyx_mstate_global->__pyx_n_s_rollback -#define __pyx_n_u_root __pyx_mstate_global->__pyx_n_u_root -#define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row -#define __pyx_n_s_row_count __pyx_mstate_global->__pyx_n_s_row_count -#define __pyx_n_s_rows_iter __pyx_mstate_global->__pyx_n_s_rows_iter -#define __pyx_n_s_seconds __pyx_mstate_global->__pyx_n_s_seconds -#define __pyx_kp_u_select_database_error __pyx_mstate_global->__pyx_kp_u_select_database_error -#define __pyx_n_s_select_db __pyx_mstate_global->__pyx_n_s_select_db -#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self -#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send -#define __pyx_n_s_set_tz __pyx_mstate_global->__pyx_n_s_set_tz -#define __pyx_kp_u_set_up_tmq_config_failed __pyx_mstate_global->__pyx_kp_u_set_up_tmq_config_failed -#define __pyx_kp_u_set_up_tmq_list_failed __pyx_mstate_global->__pyx_kp_u_set_up_tmq_list_failed -#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate -#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython -#define __pyx_kp_u_setup_tmq_failed __pyx_mstate_global->__pyx_kp_u_setup_tmq_failed -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_sql __pyx_mstate_global->__pyx_n_s_sql -#define __pyx_n_s_sql_2 __pyx_mstate_global->__pyx_n_s_sql_2 -#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state -#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str -#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource -#define __pyx_n_s_subscribe __pyx_mstate_global->__pyx_n_s_subscribe -#define __pyx_n_s_table __pyx_mstate_global->__pyx_n_s_table -#define __pyx_n_s_table_2 __pyx_mstate_global->__pyx_n_s_table_2 -#define __pyx_n_s_tables __pyx_mstate_global->__pyx_n_s_tables -#define __pyx_n_s_tables_2 __pyx_mstate_global->__pyx_n_s_tables_2 -#define __pyx_n_s_taos__cinterface __pyx_mstate_global->__pyx_n_s_taos__cinterface -#define __pyx_n_s_taos__objects __pyx_mstate_global->__pyx_n_s_taos__objects -#define __pyx_kp_s_taos__objects_pyx __pyx_mstate_global->__pyx_kp_s_taos__objects_pyx -#define __pyx_n_s_taos_error __pyx_mstate_global->__pyx_n_s_taos_error -#define __pyx_n_s_taos_fetch_raw_block_a __pyx_mstate_global->__pyx_n_s_taos_fetch_raw_block_a -#define __pyx_n_s_taos_res __pyx_mstate_global->__pyx_n_s_taos_res -#define __pyx_n_s_taos_row __pyx_mstate_global->__pyx_n_s_taos_row -#define __pyx_n_u_taosdata __pyx_mstate_global->__pyx_n_u_taosdata -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw -#define __pyx_n_s_timedelta __pyx_mstate_global->__pyx_n_s_timedelta -#define __pyx_n_s_timeout __pyx_mstate_global->__pyx_n_s_timeout -#define __pyx_n_s_timezone __pyx_mstate_global->__pyx_n_s_timezone -#define __pyx_n_s_tmq_conf __pyx_mstate_global->__pyx_n_s_tmq_conf -#define __pyx_kp_u_tmq_conf_res __pyx_mstate_global->__pyx_kp_u_tmq_conf_res -#define __pyx_n_s_tmq_conf_res_2 __pyx_mstate_global->__pyx_n_s_tmq_conf_res_2 -#define __pyx_n_s_tmq_errno __pyx_mstate_global->__pyx_n_s_tmq_errno -#define __pyx_n_s_tmq_list __pyx_mstate_global->__pyx_n_s_tmq_list -#define __pyx_n_s_topic __pyx_mstate_global->__pyx_n_s_topic -#define __pyx_n_s_topic_2 __pyx_mstate_global->__pyx_n_s_topic_2 -#define __pyx_n_s_topic_assignments __pyx_mstate_global->__pyx_n_s_topic_assignments -#define __pyx_n_s_topics __pyx_mstate_global->__pyx_n_s_topics -#define __pyx_n_s_tp __pyx_mstate_global->__pyx_n_s_tp -#define __pyx_n_s_tp_2 __pyx_mstate_global->__pyx_n_s_tp_2 -#define __pyx_n_s_tta __pyx_mstate_global->__pyx_n_s_tta -#define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type -#define __pyx_kp_u_type_2 __pyx_mstate_global->__pyx_kp_u_type_2 -#define __pyx_n_s_type_3 __pyx_mstate_global->__pyx_n_s_type_3 -#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing -#define __pyx_n_s_tz __pyx_mstate_global->__pyx_n_s_tz -#define __pyx_n_s_unsubscribe __pyx_mstate_global->__pyx_n_s_unsubscribe -#define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update -#define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate -#define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user -#define __pyx_n_s_utc_datetime_epoch __pyx_mstate_global->__pyx_n_s_utc_datetime_epoch -#define __pyx_n_s_utc_tz __pyx_mstate_global->__pyx_n_s_utc_tz -#define __pyx_n_s_utcfromtimestamp __pyx_mstate_global->__pyx_n_s_utcfromtimestamp -#define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 -#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v -#define __pyx_n_s_v_2 __pyx_mstate_global->__pyx_n_s_v_2 -#define __pyx_n_s_vg_id __pyx_mstate_global->__pyx_n_s_vg_id -#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_int_86400 __pyx_mstate_global->__pyx_int_86400 -#define __pyx_int_17084266 __pyx_mstate_global->__pyx_int_17084266 -#define __pyx_int_126557407 __pyx_mstate_global->__pyx_int_126557407 -#define __pyx_int_199624353 __pyx_mstate_global->__pyx_int_199624353 -#define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ -#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 -#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 -#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 -#define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 -#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 -#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 -#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 -#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 -#define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 -#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 -#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 -#define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 -#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 -#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 -#define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 -#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 -#define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 -#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 -#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 -#define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80 -#define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 -#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82 -#define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 -#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 -#define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85 -#define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86 -#define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 -#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88 -#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 -#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90 -#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 -#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92 -#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 -#define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94 -#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 -#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96 -#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 -#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98 -#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99 -#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 -#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 -#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100 -#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 -#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 -#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 -#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 -#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 -#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 -#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 -#define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 -#define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 -#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 -#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 -#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 -#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 -#define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 -#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 -#define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 -#define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 -#define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 -#define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 -#define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 -#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 -#define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 -#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 -#define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 -#define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 -#define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 -#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 -#define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 -#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 -#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 -#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 -#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 -#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 -#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 -#define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 -#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 -#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 -#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 -#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 -#define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 -#define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 -/* #### Code section: module_code ### */ - -/* "taos/_objects.pyx":22 - * - * - * def set_tz(tz): # <<<<<<<<<<<<<< - * global _priv_tz, _priv_datetime_epoch - * _priv_tz = tz - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_1set_tz(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_set_tz, "set_tz(tz)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_1set_tz = {"set_tz", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_1set_tz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_set_tz}; -static PyObject *__pyx_pw_4taos_8_objects_1set_tz(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_tz = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_tz (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tz,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_tz") < 0)) __PYX_ERR(0, 22, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_tz = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_tz", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 22, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.set_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_set_tz(__pyx_self, __pyx_v_tz); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_set_tz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj_) - __Pyx_RefNannySetupContext("set_tz", 0); - __Pyx_TraceCall("set_tz", __pyx_f[0], 22, 0, __PYX_ERR(0, 22, __pyx_L1_error)); - - /* "taos/_objects.pyx":24 - * def set_tz(tz): - * global _priv_tz, _priv_datetime_epoch - * _priv_tz = tz # <<<<<<<<<<<<<< - * _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_priv_tz, __pyx_v_tz) < 0) __PYX_ERR(0, 24, __pyx_L1_error) - - /* "taos/_objects.pyx":25 - * global _priv_tz, _priv_datetime_epoch - * _priv_tz = tz - * _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_utc_datetime_epoch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astimezone); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_priv_tz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - if (PyDict_SetItem(__pyx_d, __pyx_n_s_priv_datetime_epoch, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_objects.pyx":22 - * - * - * def set_tz(tz): # <<<<<<<<<<<<<< - * global _priv_tz, _priv_datetime_epoch - * _priv_tz = tz - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("taos._objects.set_tz", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":28 - * - * - * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: # <<<<<<<<<<<<<< - * with gil: - * callback = param - */ - -static void __pyx_f_4taos_8_objects_async_callback_wrapper(void *__pyx_v_param, TAOS_RES *__pyx_v_res, int __pyx_v_code) { - PyObject *__pyx_v_callback = NULL; - PyObject *__pyx_v_dt_epoch = NULL; - TAOS_FIELD *__pyx_v_fields; - int __pyx_v_field_count; - PyObject *__pyx_v_taos_fields = NULL; - PyObject *__pyx_v_block = NULL; - CYTHON_UNUSED PyObject *__pyx_v_num_of_rows = NULL; - int __pyx_v_errno; - PyObject *__pyx_v_row = NULL; - TAOS_FIELD __pyx_7genexpr__pyx_v_f; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - TAOS_FIELD *__pyx_t_5; - TAOS_FIELD *__pyx_t_6; - TAOS_FIELD *__pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_t_11; - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save; - #endif - __Pyx_RefNannySetupContext("async_callback_wrapper", 1); - __Pyx_TraceCall("async_callback_wrapper", __pyx_f[0], 28, 1, __PYX_ERR(0, 28, __pyx_L1_error)); - - /* "taos/_objects.pyx":29 - * - * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: - * with gil: # <<<<<<<<<<<<<< - * callback = param - * print("callback:", callback, res, code) - */ - { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - /*try:*/ { - - /* "taos/_objects.pyx":30 - * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: - * with gil: - * callback = param # <<<<<<<<<<<<<< - * print("callback:", callback, res, code) - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - */ - __pyx_t_1 = ((PyObject *)__pyx_v_param); - __Pyx_INCREF(__pyx_t_1); - __pyx_v_callback = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":31 - * with gil: - * callback = param - * print("callback:", callback, res, code) # <<<<<<<<<<<<<< - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - * fields = taos_fetch_fields(res) - */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_kp_u_callback); - __Pyx_GIVEREF(__pyx_kp_u_callback); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_callback); - __Pyx_INCREF(__pyx_v_callback); - __Pyx_GIVEREF(__pyx_v_callback); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_callback); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":32 - * callback = param - * print("callback:", callback, res, code) - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch # <<<<<<<<<<<<<< - * fields = taos_fetch_fields(res) - * field_count = taos_field_count(res) - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 32, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - __pyx_t_3 = 0; - } - __pyx_v_dt_epoch = __pyx_t_2; - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":33 - * print("callback:", callback, res, code) - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - * fields = taos_fetch_fields(res) # <<<<<<<<<<<<<< - * field_count = taos_field_count(res) - * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] - */ - __pyx_v_fields = taos_fetch_fields(__pyx_v_res); - - /* "taos/_objects.pyx":34 - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - * fields = taos_fetch_fields(res) - * field_count = taos_field_count(res) # <<<<<<<<<<<<<< - * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] - * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) - */ - __pyx_v_field_count = taos_field_count(__pyx_v_res); - - /* "taos/_objects.pyx":35 - * fields = taos_fetch_fields(res) - * field_count = taos_field_count(res) - * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] # <<<<<<<<<<<<<< - * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) - * errno = taos_errno(res) - */ - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = (__pyx_v_fields + __pyx_v_field_count); - for (__pyx_t_7 = __pyx_v_fields; __pyx_t_7 < __pyx_t_6; __pyx_t_7++) { - __pyx_t_5 = __pyx_t_7; - __pyx_7genexpr__pyx_v_f = (__pyx_t_5[0]); - __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_7genexpr__pyx_v_f.name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__pyx_t_3 == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode"); - __PYX_ERR(0, 35, __pyx_L4_error) - } - __pyx_t_1 = __Pyx_decode_bytes(((PyObject*)__pyx_t_3), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int8_t(__pyx_7genexpr__pyx_v_f.type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_7genexpr__pyx_v_f.bytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 35, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4taos_8_objects_TaosField), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 35, __pyx_L4_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - } /* exit inner scope */ - __pyx_v_taos_fields = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":36 - * field_count = taos_field_count(res) - * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] - * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) # <<<<<<<<<<<<<< - * errno = taos_errno(res) - * - */ - __pyx_t_2 = __pyx_f_4taos_11_cinterface_taos_fetch_block_v3(__pyx_v_res, __pyx_v_fields, __pyx_v_field_count, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 36, __pyx_L4_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_8 = PyList_GET_ITEM(sequence, 0); - __pyx_t_9 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_9); - #else - __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); - index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 2) < 0) __PYX_ERR(0, 36, __pyx_L4_error) - __pyx_t_10 = NULL; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L9_unpacking_done; - __pyx_L8_unpacking_failed:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 36, __pyx_L4_error) - __pyx_L9_unpacking_done:; - } - __pyx_v_block = __pyx_t_8; - __pyx_t_8 = 0; - __pyx_v_num_of_rows = __pyx_t_9; - __pyx_t_9 = 0; - - /* "taos/_objects.pyx":37 - * taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] - * block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) - * errno = taos_errno(res) # <<<<<<<<<<<<<< - * - * if errno != 0: - */ - __pyx_v_errno = taos_errno(__pyx_v_res); - - /* "taos/_objects.pyx":39 - * errno = taos_errno(res) - * - * if errno != 0: # <<<<<<<<<<<<<< - * raise ProgrammingError(taos_errstr(res), errno) - * - */ - __pyx_t_4 = (__pyx_v_errno != 0); - if (unlikely(__pyx_t_4)) { - - /* "taos/_objects.pyx":40 - * - * if errno != 0: - * raise ProgrammingError(taos_errstr(res), errno) # <<<<<<<<<<<<<< - * - * for row in map(tuple, zip(*block)): - */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 40, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyBytes_FromString(taos_errstr(__pyx_v_res)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 40, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = NULL; - __pyx_t_11 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_8, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 40, __pyx_L4_error) - - /* "taos/_objects.pyx":39 - * errno = taos_errno(res) - * - * if errno != 0: # <<<<<<<<<<<<<< - * raise ProgrammingError(taos_errstr(res), errno) - * - */ - } - - /* "taos/_objects.pyx":42 - * raise ProgrammingError(taos_errstr(res), errno) - * - * for row in map(tuple, zip(*block)): # <<<<<<<<<<<<<< - * callback(row, taos_fields) - * - */ - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_block); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF((PyObject *)(&PyTuple_Type)); - __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { - __pyx_t_2 = __pyx_t_9; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0; - __pyx_t_13 = NULL; - } else { - __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 42, __pyx_L4_error) - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 42, __pyx_L4_error) - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - #endif - } else { - if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 42, __pyx_L4_error) - #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - #endif - } - } else { - __pyx_t_9 = __pyx_t_13(__pyx_t_2); - if (unlikely(!__pyx_t_9)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 42, __pyx_L4_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_9); - } - __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_9); - __pyx_t_9 = 0; - - /* "taos/_objects.pyx":43 - * - * for row in map(tuple, zip(*block)): - * callback(row, taos_fields) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_INCREF(__pyx_v_callback); - __pyx_t_3 = __pyx_v_callback; __pyx_t_8 = NULL; - __pyx_t_11 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_11 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_row, __pyx_v_taos_fields}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L4_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - - /* "taos/_objects.pyx":42 - * raise ProgrammingError(taos_errstr(res), errno) - * - * for row in map(tuple, zip(*block)): # <<<<<<<<<<<<<< - * callback(row, taos_fields) - * - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - - /* "taos/_objects.pyx":29 - * - * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: - * with gil: # <<<<<<<<<<<<<< - * callback = param - * print("callback:", callback, res, code) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - goto __pyx_L5; - } - __pyx_L4_error: { - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - goto __pyx_L1_error; - } - __pyx_L5:; - } - } - - /* "taos/_objects.pyx":28 - * - * - * cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: # <<<<<<<<<<<<<< - * with gil: - * callback = param - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("taos._objects.async_callback_wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif - __pyx_L0:; - #ifdef WITH_THREAD - __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif - __Pyx_XDECREF(__pyx_v_callback); - __Pyx_XDECREF(__pyx_v_dt_epoch); - __Pyx_XDECREF(__pyx_v_taos_fields); - __Pyx_XDECREF(__pyx_v_block); - __Pyx_XDECREF(__pyx_v_num_of_rows); - __Pyx_XDECREF(__pyx_v_row); - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - #ifdef WITH_THREAD - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #endif -} - -/* "taos/_objects.pyx":56 - * cdef TAOS *_raw_conn - * - * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): # <<<<<<<<<<<<<< - * if host: - * host = host.encode("utf-8") - */ - -/* Python wrapper */ -static int __pyx_pw_4taos_8_objects_14TaosConnection_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_4taos_8_objects_14TaosConnection_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_host = 0; - PyObject *__pyx_v_user = 0; - PyObject *__pyx_v_password = 0; - PyObject *__pyx_v_database = 0; - PyObject *__pyx_v_port = 0; - PyObject *__pyx_v_timezone = 0; - PyObject *__pyx_v_config = 0; - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_user,&__pyx_n_s_password,&__pyx_n_s_database,&__pyx_n_s_port,&__pyx_n_s_timezone,&__pyx_n_s_config,0}; - PyObject* values[7] = {0,0,0,0,0,0,0}; - values[0] = ((PyObject *)Py_None); - values[1] = ((PyObject *)__pyx_n_u_root); - values[2] = ((PyObject *)__pyx_n_u_taosdata); - values[3] = ((PyObject *)Py_None); - values[4] = ((PyObject *)Py_None); - values[5] = ((PyObject *)Py_None); - values[6] = ((PyObject *)Py_None); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 7: values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host); - if (value) { values[0] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_user); - if (value) { values[1] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_password); - if (value) { values[2] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_database); - if (value) { values[3] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_port); - if (value) { values[4] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timezone); - if (value) { values[5] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_config); - if (value) { values[6] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 7: values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_host = values[0]; - __pyx_v_user = values[1]; - __pyx_v_password = values[2]; - __pyx_v_database = values[3]; - __pyx_v_port = values[4]; - __pyx_v_timezone = values[5]; - __pyx_v_config = values[6]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 7, __pyx_nargs); __PYX_ERR(0, 56, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection___cinit__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_host, __pyx_v_user, __pyx_v_password, __pyx_v_database, __pyx_v_port, __pyx_v_timezone, __pyx_v_config); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4taos_8_objects_14TaosConnection___cinit__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_user, PyObject *__pyx_v_password, PyObject *__pyx_v_database, PyObject *__pyx_v_port, PyObject *__pyx_v_timezone, PyObject *__pyx_v_config) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - char *__pyx_t_6; - uint16_t __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); - __Pyx_TraceCall("__cinit__", __pyx_f[0], 56, 0, __PYX_ERR(0, 56, __pyx_L1_error)); - __Pyx_INCREF(__pyx_v_host); - __Pyx_INCREF(__pyx_v_user); - __Pyx_INCREF(__pyx_v_password); - __Pyx_INCREF(__pyx_v_database); - __Pyx_INCREF(__pyx_v_timezone); - __Pyx_INCREF(__pyx_v_config); - - /* "taos/_objects.pyx":57 - * - * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): - * if host: # <<<<<<<<<<<<<< - * host = host.encode("utf-8") - * self._host = host - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_host); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":58 - * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): - * if host: - * host = host.encode("utf-8") # <<<<<<<<<<<<<< - * self._host = host - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_host, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF_SET(__pyx_v_host, __pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":59 - * if host: - * host = host.encode("utf-8") - * self._host = host # <<<<<<<<<<<<<< - * - * if user: - */ - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_host); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error) - __pyx_v_self->_host = __pyx_t_6; - - /* "taos/_objects.pyx":57 - * - * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): - * if host: # <<<<<<<<<<<<<< - * host = host.encode("utf-8") - * self._host = host - */ - } - - /* "taos/_objects.pyx":61 - * self._host = host - * - * if user: # <<<<<<<<<<<<<< - * user = user.encode("utf-8") - * self._user = user - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 61, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":62 - * - * if user: - * user = user.encode("utf-8") # <<<<<<<<<<<<<< - * self._user = user - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_user, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF_SET(__pyx_v_user, __pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":63 - * if user: - * user = user.encode("utf-8") - * self._user = user # <<<<<<<<<<<<<< - * - * if password: - */ - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_user); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) - __pyx_v_self->_user = __pyx_t_6; - - /* "taos/_objects.pyx":61 - * self._host = host - * - * if user: # <<<<<<<<<<<<<< - * user = user.encode("utf-8") - * self._user = user - */ - } - - /* "taos/_objects.pyx":65 - * self._user = user - * - * if password: # <<<<<<<<<<<<<< - * password = password.encode("utf-8") - * self._password = password - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_password); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":66 - * - * if password: - * password = password.encode("utf-8") # <<<<<<<<<<<<<< - * self._password = password - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_password, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF_SET(__pyx_v_password, __pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":67 - * if password: - * password = password.encode("utf-8") - * self._password = password # <<<<<<<<<<<<<< - * - * if database: - */ - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_password); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) - __pyx_v_self->_password = __pyx_t_6; - - /* "taos/_objects.pyx":65 - * self._user = user - * - * if password: # <<<<<<<<<<<<<< - * password = password.encode("utf-8") - * self._password = password - */ - } - - /* "taos/_objects.pyx":69 - * self._password = password - * - * if database: # <<<<<<<<<<<<<< - * database =database.encode("utf-8") - * self._database = database - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_database); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":70 - * - * if database: - * database =database.encode("utf-8") # <<<<<<<<<<<<<< - * self._database = database - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_database, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF_SET(__pyx_v_database, __pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":71 - * if database: - * database =database.encode("utf-8") - * self._database = database # <<<<<<<<<<<<<< - * - * if port: - */ - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_database); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) - __pyx_v_self->_database = __pyx_t_6; - - /* "taos/_objects.pyx":69 - * self._password = password - * - * if database: # <<<<<<<<<<<<<< - * database =database.encode("utf-8") - * self._database = database - */ - } - - /* "taos/_objects.pyx":73 - * self._database = database - * - * if port: # <<<<<<<<<<<<<< - * self._port = port - * - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_port); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 73, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":74 - * - * if port: - * self._port = port # <<<<<<<<<<<<<< - * - * if timezone: - */ - __pyx_t_7 = __Pyx_PyInt_As_uint16_t(__pyx_v_port); if (unlikely((__pyx_t_7 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error) - __pyx_v_self->_port = __pyx_t_7; - - /* "taos/_objects.pyx":73 - * self._database = database - * - * if port: # <<<<<<<<<<<<<< - * self._port = port - * - */ - } - - /* "taos/_objects.pyx":76 - * self._port = port - * - * if timezone: # <<<<<<<<<<<<<< - * timezone = timezone.encode("utf-8") - * self._tz = timezone - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_timezone); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 76, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":77 - * - * if timezone: - * timezone = timezone.encode("utf-8") # <<<<<<<<<<<<<< - * self._tz = timezone - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timezone, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF_SET(__pyx_v_timezone, __pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":78 - * if timezone: - * timezone = timezone.encode("utf-8") - * self._tz = timezone # <<<<<<<<<<<<<< - * - * if config: - */ - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_timezone); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error) - __pyx_v_self->_tz = __pyx_t_6; - - /* "taos/_objects.pyx":76 - * self._port = port - * - * if timezone: # <<<<<<<<<<<<<< - * timezone = timezone.encode("utf-8") - * self._tz = timezone - */ - } - - /* "taos/_objects.pyx":80 - * self._tz = timezone - * - * if config: # <<<<<<<<<<<<<< - * config = config.encode("utf-8") - * self._config = config - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_config); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 80, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":81 - * - * if config: - * config = config.encode("utf-8") # <<<<<<<<<<<<<< - * self._config = config - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_config, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_utf_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF_SET(__pyx_v_config, __pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":82 - * if config: - * config = config.encode("utf-8") - * self._config = config # <<<<<<<<<<<<<< - * - * self._init_options() - */ - __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_config); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) - __pyx_v_self->_config = __pyx_t_6; - - /* "taos/_objects.pyx":80 - * self._tz = timezone - * - * if config: # <<<<<<<<<<<<<< - * config = config.encode("utf-8") - * self._config = config - */ - } - - /* "taos/_objects.pyx":84 - * self._config = config - * - * self._init_options() # <<<<<<<<<<<<<< - * self._init_conn() - * self._check_conn_error() - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":85 - * - * self._init_options() - * self._init_conn() # <<<<<<<<<<<<<< - * self._check_conn_error() - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_conn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":86 - * self._init_options() - * self._init_conn() - * self._check_conn_error() # <<<<<<<<<<<<<< - * - * def _init_options(self): - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_conn_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":56 - * cdef TAOS *_raw_conn - * - * def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): # <<<<<<<<<<<<<< - * if host: - * host = host.encode("utf-8") - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("taos._objects.TaosConnection.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_host); - __Pyx_XDECREF(__pyx_v_user); - __Pyx_XDECREF(__pyx_v_password); - __Pyx_XDECREF(__pyx_v_database); - __Pyx_XDECREF(__pyx_v_timezone); - __Pyx_XDECREF(__pyx_v_config); - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":88 - * self._check_conn_error() - * - * def _init_options(self): # <<<<<<<<<<<<<< - * if self._tz: - * tz = self._tz - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_3_init_options(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_2_init_options, "TaosConnection._init_options(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_3_init_options = {"_init_options", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_3_init_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_2_init_options}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_3_init_options(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_init_options (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("_init_options", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_init_options", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_2_init_options(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_2_init_options(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - PyObject *__pyx_v_tz = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__2) - __Pyx_RefNannySetupContext("_init_options", 0); - __Pyx_TraceCall("_init_options", __pyx_f[0], 88, 0, __PYX_ERR(0, 88, __pyx_L1_error)); - - /* "taos/_objects.pyx":89 - * - * def _init_options(self): - * if self._tz: # <<<<<<<<<<<<<< - * tz = self._tz - * set_tz(pytz.timezone(tz.decode("utf-8"))) - */ - __pyx_t_1 = (__pyx_v_self->_tz != 0); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":90 - * def _init_options(self): - * if self._tz: - * tz = self._tz # <<<<<<<<<<<<<< - * set_tz(pytz.timezone(tz.decode("utf-8"))) - * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) - */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_tz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_tz = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "taos/_objects.pyx":91 - * if self._tz: - * tz = self._tz - * set_tz(pytz.timezone(tz.decode("utf-8"))) # <<<<<<<<<<<<<< - * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_tz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pytz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_timezone); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(__pyx_v_tz == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode"); - __PYX_ERR(0, 91, __pyx_L1_error) - } - __pyx_t_5 = __Pyx_decode_bytes(__pyx_v_tz, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_6 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_8 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":92 - * tz = self._tz - * set_tz(pytz.timezone(tz.decode("utf-8"))) - * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) # <<<<<<<<<<<<<< - * - * if self._config: - */ - (void)(taos_options(TSDB_OPTION_TIMEZONE, __pyx_v_self->_tz)); - - /* "taos/_objects.pyx":89 - * - * def _init_options(self): - * if self._tz: # <<<<<<<<<<<<<< - * tz = self._tz - * set_tz(pytz.timezone(tz.decode("utf-8"))) - */ - } - - /* "taos/_objects.pyx":94 - * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) - * - * if self._config: # <<<<<<<<<<<<<< - * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) - * - */ - __pyx_t_1 = (__pyx_v_self->_config != 0); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":95 - * - * if self._config: - * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) # <<<<<<<<<<<<<< - * - * def _init_conn(self): - */ - (void)(taos_options(TSDB_OPTION_CONFIGDIR, __pyx_v_self->_config)); - - /* "taos/_objects.pyx":94 - * taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) - * - * if self._config: # <<<<<<<<<<<<<< - * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) - * - */ - } - - /* "taos/_objects.pyx":88 - * self._check_conn_error() - * - * def _init_options(self): # <<<<<<<<<<<<<< - * if self._tz: - * tz = self._tz - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("taos._objects.TaosConnection._init_options", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_tz); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":97 - * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) - * - * def _init_conn(self): # <<<<<<<<<<<<<< - * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_5_init_conn(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_4_init_conn, "TaosConnection._init_conn(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_5_init_conn = {"_init_conn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_5_init_conn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_4_init_conn}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_5_init_conn(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_init_conn (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("_init_conn", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_init_conn", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_4_init_conn(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_4_init_conn(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__3) - __Pyx_RefNannySetupContext("_init_conn", 0); - __Pyx_TraceCall("_init_conn", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error)); - - /* "taos/_objects.pyx":98 - * - * def _init_conn(self): - * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) # <<<<<<<<<<<<<< - * - * def _check_conn_error(self): - */ - __pyx_v_self->_raw_conn = taos_connect(__pyx_v_self->_host, __pyx_v_self->_user, __pyx_v_self->_password, __pyx_v_self->_database, __pyx_v_self->_port); - - /* "taos/_objects.pyx":97 - * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) - * - * def _init_conn(self): # <<<<<<<<<<<<<< - * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection._init_conn", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":100 - * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - * - * def _check_conn_error(self): # <<<<<<<<<<<<<< - * errno = taos_errno(self._raw_conn) - * if errno != 0: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_7_check_conn_error(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_6_check_conn_error, "TaosConnection._check_conn_error(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_7_check_conn_error = {"_check_conn_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_7_check_conn_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_6_check_conn_error}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_7_check_conn_error(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_check_conn_error (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("_check_conn_error", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_check_conn_error", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_6_check_conn_error(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_6_check_conn_error(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - int __pyx_v_errno; - char *__pyx_v_errstr; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__4) - __Pyx_RefNannySetupContext("_check_conn_error", 0); - __Pyx_TraceCall("_check_conn_error", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error)); - - /* "taos/_objects.pyx":101 - * - * def _check_conn_error(self): - * errno = taos_errno(self._raw_conn) # <<<<<<<<<<<<<< - * if errno != 0: - * errstr = taos_errstr(self._raw_conn) - */ - __pyx_v_errno = taos_errno(__pyx_v_self->_raw_conn); - - /* "taos/_objects.pyx":102 - * def _check_conn_error(self): - * errno = taos_errno(self._raw_conn) - * if errno != 0: # <<<<<<<<<<<<<< - * errstr = taos_errstr(self._raw_conn) - * raise ConnectionError(errstr, errno) - */ - __pyx_t_1 = (__pyx_v_errno != 0); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":103 - * errno = taos_errno(self._raw_conn) - * if errno != 0: - * errstr = taos_errstr(self._raw_conn) # <<<<<<<<<<<<<< - * raise ConnectionError(errstr, errno) - * - */ - __pyx_v_errstr = taos_errstr(__pyx_v_self->_raw_conn); - - /* "taos/_objects.pyx":104 - * if errno != 0: - * errstr = taos_errstr(self._raw_conn) - * raise ConnectionError(errstr, errno) # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_errstr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 104, __pyx_L1_error) - - /* "taos/_objects.pyx":102 - * def _check_conn_error(self): - * errno = taos_errno(self._raw_conn) - * if errno != 0: # <<<<<<<<<<<<<< - * errstr = taos_errstr(self._raw_conn) - * raise ConnectionError(errstr, errno) - */ - } - - /* "taos/_objects.pyx":100 - * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - * - * def _check_conn_error(self): # <<<<<<<<<<<<<< - * errno = taos_errno(self._raw_conn) - * if errno != 0: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("taos._objects.TaosConnection._check_conn_error", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":106 - * raise ConnectionError(errstr, errno) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * self.close() - * - */ - -/* Python wrapper */ -static void __pyx_pw_4taos_8_objects_14TaosConnection_9__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_4taos_8_objects_14TaosConnection_9__dealloc__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_4taos_8_objects_14TaosConnection_8__dealloc__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_4taos_8_objects_14TaosConnection_8__dealloc__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__dealloc__", 0); - __Pyx_TraceCall("__dealloc__", __pyx_f[0], 106, 0, __PYX_ERR(0, 106, __pyx_L1_error)); - - /* "taos/_objects.pyx":107 - * - * def __dealloc__(self): - * self.close() # <<<<<<<<<<<<<< - * - * def close(self): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_objects.pyx":106 - * raise ConnectionError(errstr, errno) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * self.close() - * - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("taos._objects.TaosConnection.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); -} - -/* "taos/_objects.pyx":109 - * self.close() - * - * def close(self): # <<<<<<<<<<<<<< - * if self._raw_conn is not NULL: - * taos_close(self._raw_conn) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11close(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_10close, "TaosConnection.close(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_11close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_11close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_10close}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11close(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("close (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_10close(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_10close(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__5) - __Pyx_RefNannySetupContext("close", 0); - __Pyx_TraceCall("close", __pyx_f[0], 109, 0, __PYX_ERR(0, 109, __pyx_L1_error)); - - /* "taos/_objects.pyx":110 - * - * def close(self): - * if self._raw_conn is not NULL: # <<<<<<<<<<<<<< - * taos_close(self._raw_conn) - * self._raw_conn = NULL - */ - __pyx_t_1 = (__pyx_v_self->_raw_conn != NULL); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":111 - * def close(self): - * if self._raw_conn is not NULL: - * taos_close(self._raw_conn) # <<<<<<<<<<<<<< - * self._raw_conn = NULL - * - */ - taos_close(__pyx_v_self->_raw_conn); - - /* "taos/_objects.pyx":112 - * if self._raw_conn is not NULL: - * taos_close(self._raw_conn) - * self._raw_conn = NULL # <<<<<<<<<<<<<< - * - * @property - */ - __pyx_v_self->_raw_conn = NULL; - - /* "taos/_objects.pyx":110 - * - * def close(self): - * if self._raw_conn is not NULL: # <<<<<<<<<<<<<< - * taos_close(self._raw_conn) - * self._raw_conn = NULL - */ - } - - /* "taos/_objects.pyx":109 - * self.close() - * - * def close(self): # <<<<<<<<<<<<<< - * if self._raw_conn is not NULL: - * taos_close(self._raw_conn) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.close", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":114 - * self._raw_conn = NULL - * - * @property # <<<<<<<<<<<<<< - * def client_info(self): - * return taos_get_client_info().decode("utf-8") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11client_info_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11client_info_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_11client_info___get__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_11client_info___get__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - char const *__pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 114, 0, __PYX_ERR(0, 114, __pyx_L1_error)); - - /* "taos/_objects.pyx":116 - * @property - * def client_info(self): - * return taos_get_client_info().decode("utf-8") # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = taos_get_client_info(); - __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":114 - * self._raw_conn = NULL - * - * @property # <<<<<<<<<<<<<< - * def client_info(self): - * return taos_get_client_info().decode("utf-8") - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("taos._objects.TaosConnection.client_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":118 - * return taos_get_client_info().decode("utf-8") - * - * @property # <<<<<<<<<<<<<< - * def server_info(self): - * # type: () -> str - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11server_info_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_11server_info_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_11server_info___get__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_11server_info___get__(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - char const *__pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 118, 0, __PYX_ERR(0, 118, __pyx_L1_error)); - - /* "taos/_objects.pyx":121 - * def server_info(self): - * # type: () -> str - * if self._raw_conn is NULL: # <<<<<<<<<<<<<< - * return - * return taos_get_server_info(self._raw_conn).decode("utf-8") - */ - __pyx_t_1 = (__pyx_v_self->_raw_conn == NULL); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":122 - * # type: () -> str - * if self._raw_conn is NULL: - * return # <<<<<<<<<<<<<< - * return taos_get_server_info(self._raw_conn).decode("utf-8") - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "taos/_objects.pyx":121 - * def server_info(self): - * # type: () -> str - * if self._raw_conn is NULL: # <<<<<<<<<<<<<< - * return - * return taos_get_server_info(self._raw_conn).decode("utf-8") - */ - } - - /* "taos/_objects.pyx":123 - * if self._raw_conn is NULL: - * return - * return taos_get_server_info(self._raw_conn).decode("utf-8") # <<<<<<<<<<<<<< - * - * def select_db(self, database: str): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = taos_get_server_info(__pyx_v_self->_raw_conn); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":118 - * return taos_get_client_info().decode("utf-8") - * - * @property # <<<<<<<<<<<<<< - * def server_info(self): - * # type: () -> str - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("taos._objects.TaosConnection.server_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":125 - * return taos_get_server_info(self._raw_conn).decode("utf-8") - * - * def select_db(self, database: str): # <<<<<<<<<<<<<< - * _database = database.encode("utf-8") - * res = taos_select_db(self._raw_conn, _database) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_13select_db(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_12select_db, "TaosConnection.select_db(self, unicode database: str)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_13select_db = {"select_db", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_13select_db, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_12select_db}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_13select_db(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_database = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("select_db (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_database,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_database)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "select_db") < 0)) __PYX_ERR(0, 125, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_database = ((PyObject*)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("select_db", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 125, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.select_db", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_database), (&PyUnicode_Type), 0, "database", 1))) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_12select_db(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_database); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_12select_db(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_database) { - PyObject *__pyx_v__database = NULL; - int __pyx_v_res; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - char const *__pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__6) - __Pyx_RefNannySetupContext("select_db", 0); - __Pyx_TraceCall("select_db", __pyx_f[0], 125, 0, __PYX_ERR(0, 125, __pyx_L1_error)); - - /* "taos/_objects.pyx":126 - * - * def select_db(self, database: str): - * _database = database.encode("utf-8") # <<<<<<<<<<<<<< - * res = taos_select_db(self._raw_conn, _database) - * if res != 0: - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__database = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":127 - * def select_db(self, database: str): - * _database = database.encode("utf-8") - * res = taos_select_db(self._raw_conn, _database) # <<<<<<<<<<<<<< - * if res != 0: - * raise DatabaseError("select database error", res) - */ - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__database); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L1_error) - __pyx_v_res = taos_select_db(__pyx_v_self->_raw_conn, __pyx_t_2); - - /* "taos/_objects.pyx":128 - * _database = database.encode("utf-8") - * res = taos_select_db(self._raw_conn, _database) - * if res != 0: # <<<<<<<<<<<<<< - * raise DatabaseError("select database error", res) - * - */ - __pyx_t_3 = (__pyx_v_res != 0); - if (unlikely(__pyx_t_3)) { - - /* "taos/_objects.pyx":129 - * res = taos_select_db(self._raw_conn, _database) - * if res != 0: - * raise DatabaseError("select database error", res) # <<<<<<<<<<<<<< - * - * def execute(self, sql: str, req_id: Optional[int] = None): - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_kp_u_select_database_error, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 129, __pyx_L1_error) - - /* "taos/_objects.pyx":128 - * _database = database.encode("utf-8") - * res = taos_select_db(self._raw_conn, _database) - * if res != 0: # <<<<<<<<<<<<<< - * raise DatabaseError("select database error", res) - * - */ - } - - /* "taos/_objects.pyx":125 - * return taos_get_server_info(self._raw_conn).decode("utf-8") - * - * def select_db(self, database: str): # <<<<<<<<<<<<<< - * _database = database.encode("utf-8") - * res = taos_select_db(self._raw_conn, _database) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("taos._objects.TaosConnection.select_db", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__database); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":131 - * raise DatabaseError("select database error", res) - * - * def execute(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * return self.query(sql, req_id).affected_rows - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_15execute(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_14execute, "TaosConnection.execute(self, unicode sql: str, int req_id: Optional[int] = None)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_15execute = {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_15execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_14execute}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_15execute(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_sql = 0; - PyObject *__pyx_v_req_id = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("execute (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sql,&__pyx_n_s_req_id,0}; - PyObject* values[2] = {0,0}; - values[1] = ((PyObject*)Py_None); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sql)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_req_id); - if (value) { values[1] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "execute") < 0)) __PYX_ERR(0, 131, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_sql = ((PyObject*)values[0]); - __pyx_v_req_id = ((PyObject*)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("execute", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 131, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sql), (&PyUnicode_Type), 0, "sql", 1))) __PYX_ERR(0, 131, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_req_id), (&PyInt_Type), 1, "req_id", 1))) __PYX_ERR(0, 131, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_14execute(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_sql, __pyx_v_req_id); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_14execute(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_req_id) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__7) - __Pyx_RefNannySetupContext("execute", 0); - __Pyx_TraceCall("execute", __pyx_f[0], 131, 0, __PYX_ERR(0, 131, __pyx_L1_error)); - - /* "taos/_objects.pyx":132 - * - * def execute(self, sql: str, req_id: Optional[int] = None): - * return self.query(sql, req_id).affected_rows # <<<<<<<<<<<<<< - * - * def query(self, sql: str, req_id: Optional[int] = None): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_sql, __pyx_v_req_id}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_affected_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":131 - * raise DatabaseError("select database error", res) - * - * def execute(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * return self.query(sql, req_id).affected_rows - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("taos._objects.TaosConnection.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":134 - * return self.query(sql, req_id).affected_rows - * - * def query(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * _sql = sql.encode("utf-8") - * if req_id is None: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_17query(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_16query, "TaosConnection.query(self, unicode sql: str, int req_id: Optional[int] = None)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_17query = {"query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_17query, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_16query}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_17query(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_sql = 0; - PyObject *__pyx_v_req_id = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("query (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sql,&__pyx_n_s_req_id,0}; - PyObject* values[2] = {0,0}; - values[1] = ((PyObject*)Py_None); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sql)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_req_id); - if (value) { values[1] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "query") < 0)) __PYX_ERR(0, 134, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_sql = ((PyObject*)values[0]); - __pyx_v_req_id = ((PyObject*)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("query", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.query", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sql), (&PyUnicode_Type), 0, "sql", 1))) __PYX_ERR(0, 134, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_req_id), (&PyInt_Type), 1, "req_id", 1))) __PYX_ERR(0, 134, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_16query(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_sql, __pyx_v_req_id); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_16query(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_req_id) { - PyObject *__pyx_v__sql = NULL; - TAOS_RES *__pyx_v_res; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - char const *__pyx_t_3; - char const *__pyx_t_4; - int64_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__8) - __Pyx_RefNannySetupContext("query", 0); - __Pyx_TraceCall("query", __pyx_f[0], 134, 0, __PYX_ERR(0, 134, __pyx_L1_error)); - - /* "taos/_objects.pyx":135 - * - * def query(self, sql: str, req_id: Optional[int] = None): - * _sql = sql.encode("utf-8") # <<<<<<<<<<<<<< - * if req_id is None: - * res = taos_query(self._raw_conn, _sql) - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__sql = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":136 - * def query(self, sql: str, req_id: Optional[int] = None): - * _sql = sql.encode("utf-8") - * if req_id is None: # <<<<<<<<<<<<<< - * res = taos_query(self._raw_conn, _sql) - * else: - */ - __pyx_t_2 = (__pyx_v_req_id == ((PyObject*)Py_None)); - if (__pyx_t_2) { - - /* "taos/_objects.pyx":137 - * _sql = sql.encode("utf-8") - * if req_id is None: - * res = taos_query(self._raw_conn, _sql) # <<<<<<<<<<<<<< - * else: - * res = taos_query_with_reqid(self._raw_conn, _sql, req_id) - */ - __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v__sql); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error) - __pyx_v_res = taos_query(__pyx_v_self->_raw_conn, __pyx_t_3); - - /* "taos/_objects.pyx":136 - * def query(self, sql: str, req_id: Optional[int] = None): - * _sql = sql.encode("utf-8") - * if req_id is None: # <<<<<<<<<<<<<< - * res = taos_query(self._raw_conn, _sql) - * else: - */ - goto __pyx_L3; - } - - /* "taos/_objects.pyx":139 - * res = taos_query(self._raw_conn, _sql) - * else: - * res = taos_query_with_reqid(self._raw_conn, _sql, req_id) # <<<<<<<<<<<<<< - * - * return TaosResult(res) - */ - /*else*/ { - __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v__sql); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_req_id); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) - __pyx_v_res = taos_query_with_reqid(__pyx_v_self->_raw_conn, __pyx_t_4, __pyx_t_5); - } - __pyx_L3:; - - /* "taos/_objects.pyx":141 - * res = taos_query_with_reqid(self._raw_conn, _sql, req_id) - * - * return TaosResult(res) # <<<<<<<<<<<<<< - * - * def query_a(self, sql: str, callback, req_id: Optional[int] = None): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":134 - * return self.query(sql, req_id).affected_rows - * - * def query(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * _sql = sql.encode("utf-8") - * if req_id is None: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("taos._objects.TaosConnection.query", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__sql); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":143 - * return TaosResult(res) - * - * def query_a(self, sql: str, callback, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * _sql = sql.encode("utf-8") - * if req_id is None: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_19query_a(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_18query_a, "TaosConnection.query_a(self, unicode sql: str, callback, int req_id: Optional[int] = None)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_19query_a = {"query_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_19query_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_18query_a}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_19query_a(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_sql = 0; - PyObject *__pyx_v_callback = 0; - PyObject *__pyx_v_req_id = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("query_a (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sql,&__pyx_n_s_callback_2,&__pyx_n_s_req_id,0}; - PyObject* values[3] = {0,0,0}; - values[2] = ((PyObject*)Py_None); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sql)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback_2)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("query_a", 0, 2, 3, 1); __PYX_ERR(0, 143, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_req_id); - if (value) { values[2] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "query_a") < 0)) __PYX_ERR(0, 143, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_sql = ((PyObject*)values[0]); - __pyx_v_callback = values[1]; - __pyx_v_req_id = ((PyObject*)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("query_a", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 143, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.query_a", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sql), (&PyUnicode_Type), 0, "sql", 1))) __PYX_ERR(0, 143, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_req_id), (&PyInt_Type), 1, "req_id", 1))) __PYX_ERR(0, 143, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_18query_a(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_sql, __pyx_v_callback, __pyx_v_req_id); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_18query_a(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_callback, PyObject *__pyx_v_req_id) { - PyObject *__pyx_v__sql = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - char const *__pyx_t_3; - char const *__pyx_t_4; - int64_t __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__9) - __Pyx_RefNannySetupContext("query_a", 0); - __Pyx_TraceCall("query_a", __pyx_f[0], 143, 0, __PYX_ERR(0, 143, __pyx_L1_error)); - - /* "taos/_objects.pyx":144 - * - * def query_a(self, sql: str, callback, req_id: Optional[int] = None): - * _sql = sql.encode("utf-8") # <<<<<<<<<<<<<< - * if req_id is None: - * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__sql = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":145 - * def query_a(self, sql: str, callback, req_id: Optional[int] = None): - * _sql = sql.encode("utf-8") - * if req_id is None: # <<<<<<<<<<<<<< - * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) - * else: - */ - __pyx_t_2 = (__pyx_v_req_id == ((PyObject*)Py_None)); - if (__pyx_t_2) { - - /* "taos/_objects.pyx":146 - * _sql = sql.encode("utf-8") - * if req_id is None: - * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) # <<<<<<<<<<<<<< - * else: - * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) - */ - __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v__sql); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) - taos_query_a(__pyx_v_self->_raw_conn, __pyx_t_3, __pyx_f_4taos_8_objects_async_callback_wrapper, ((void *)__pyx_v_callback)); - - /* "taos/_objects.pyx":145 - * def query_a(self, sql: str, callback, req_id: Optional[int] = None): - * _sql = sql.encode("utf-8") - * if req_id is None: # <<<<<<<<<<<<<< - * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) - * else: - */ - goto __pyx_L3; - } - - /* "taos/_objects.pyx":148 - * taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) - * else: - * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) # <<<<<<<<<<<<<< - * - * def subscribe(self, configs: dict[str, str], callback): - */ - /*else*/ { - __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v__sql); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_v_req_id); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error) - taos_query_a_with_reqid(__pyx_v_self->_raw_conn, __pyx_t_4, __pyx_f_4taos_8_objects_async_callback_wrapper, ((void *)__pyx_v_callback), __pyx_t_5); - } - __pyx_L3:; - - /* "taos/_objects.pyx":143 - * return TaosResult(res) - * - * def query_a(self, sql: str, callback, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * _sql = sql.encode("utf-8") - * if req_id is None: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosConnection.query_a", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__sql); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":150 - * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) - * - * def subscribe(self, configs: dict[str, str], callback): # <<<<<<<<<<<<<< - * if self._raw_conn is NULL: - * return None - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_21subscribe(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_20subscribe, "TaosConnection.subscribe(self, dict configs: dict[str, str], callback)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_21subscribe = {"subscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_21subscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_20subscribe}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_21subscribe(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_configs = 0; - CYTHON_UNUSED PyObject *__pyx_v_callback = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("subscribe (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_configs,&__pyx_n_s_callback_2,0}; - PyObject* values[2] = {0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_configs)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback_2)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("subscribe", 1, 2, 2, 1); __PYX_ERR(0, 150, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "subscribe") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_configs = ((PyObject*)values[0]); - __pyx_v_callback = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("subscribe", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 150, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.subscribe", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_configs), (&PyDict_Type), 0, "configs", 1))) __PYX_ERR(0, 150, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_20subscribe(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_configs, __pyx_v_callback); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_20subscribe(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_configs, CYTHON_UNUSED PyObject *__pyx_v_callback) { - tmq_conf_t *__pyx_v_tmq_conf; - PyObject *__pyx_v_k = NULL; - PyObject *__pyx_v_v = NULL; - PyObject *__pyx_v__k = NULL; - PyObject *__pyx_v__v = NULL; - tmq_conf_res_t __pyx_v_tmq_conf_res; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - char const *__pyx_t_10; - char const *__pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__10) - __Pyx_RefNannySetupContext("subscribe", 0); - __Pyx_TraceCall("subscribe", __pyx_f[0], 150, 0, __PYX_ERR(0, 150, __pyx_L1_error)); - - /* "taos/_objects.pyx":151 - * - * def subscribe(self, configs: dict[str, str], callback): - * if self._raw_conn is NULL: # <<<<<<<<<<<<<< - * return None - * - */ - __pyx_t_1 = (__pyx_v_self->_raw_conn == NULL); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":152 - * def subscribe(self, configs: dict[str, str], callback): - * if self._raw_conn is NULL: - * return None # <<<<<<<<<<<<<< - * - * tmq_conf = tmq_conf_new() - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "taos/_objects.pyx":151 - * - * def subscribe(self, configs: dict[str, str], callback): - * if self._raw_conn is NULL: # <<<<<<<<<<<<<< - * return None - * - */ - } - - /* "taos/_objects.pyx":154 - * return None - * - * tmq_conf = tmq_conf_new() # <<<<<<<<<<<<<< - * for k, v in configs.items(): - * _k = k.encode("utf-8") - */ - __pyx_v_tmq_conf = tmq_conf_new(); - - /* "taos/_objects.pyx":155 - * - * tmq_conf = tmq_conf_new() - * for k, v in configs.items(): # <<<<<<<<<<<<<< - * _k = k.encode("utf-8") - * _v = v.encode("utf-8") - */ - __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_configs, 1, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_2); - __pyx_t_2 = __pyx_t_6; - __pyx_t_6 = 0; - while (1) { - __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, &__pyx_t_7, NULL, __pyx_t_5); - if (unlikely(__pyx_t_8 == 0)) break; - if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - __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; - - /* "taos/_objects.pyx":156 - * tmq_conf = tmq_conf_new() - * for k, v in configs.items(): - * _k = k.encode("utf-8") # <<<<<<<<<<<<<< - * _v = v.encode("utf-8") - * tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_utf_8}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_XDECREF_SET(__pyx_v__k, __pyx_t_7); - __pyx_t_7 = 0; - - /* "taos/_objects.pyx":157 - * for k, v in configs.items(): - * _k = k.encode("utf-8") - * _v = v.encode("utf-8") # <<<<<<<<<<<<<< - * tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) - * print("tmq_conf_res:", tmq_conf_res) - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_utf_8}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_XDECREF_SET(__pyx_v__v, __pyx_t_7); - __pyx_t_7 = 0; - - /* "taos/_objects.pyx":158 - * _k = k.encode("utf-8") - * _v = v.encode("utf-8") - * tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) # <<<<<<<<<<<<<< - * print("tmq_conf_res:", tmq_conf_res) - * - */ - __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v__k); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v__v); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error) - __pyx_v_tmq_conf_res = tmq_conf_set(__pyx_v_tmq_conf, __pyx_t_10, __pyx_t_11); - - /* "taos/_objects.pyx":159 - * _v = v.encode("utf-8") - * tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) - * print("tmq_conf_res:", tmq_conf_res) # <<<<<<<<<<<<<< - * - * def load_table_info(self, tables: list): - */ - __pyx_t_7 = __Pyx_PyInt_From_int(((int)__pyx_v_tmq_conf_res)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_kp_u_tmq_conf_res); - __Pyx_GIVEREF(__pyx_kp_u_tmq_conf_res); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_tmq_conf_res); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":150 - * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) - * - * def subscribe(self, configs: dict[str, str], callback): # <<<<<<<<<<<<<< - * if self._raw_conn is NULL: - * return None - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("taos._objects.TaosConnection.subscribe", __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__k); - __Pyx_XDECREF(__pyx_v__v); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":161 - * print("tmq_conf_res:", tmq_conf_res) - * - * def load_table_info(self, tables: list): # <<<<<<<<<<<<<< - * # type: (str) -> None - * _tables = ",".join(tables).encode("utf-8") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_23load_table_info(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_22load_table_info, "TaosConnection.load_table_info(self, list tables: list)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_23load_table_info = {"load_table_info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_23load_table_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_22load_table_info}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_23load_table_info(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_tables = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("load_table_info (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tables,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tables)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "load_table_info") < 0)) __PYX_ERR(0, 161, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_tables = ((PyObject*)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("load_table_info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 161, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.load_table_info", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tables), (&PyList_Type), 0, "tables", 1))) __PYX_ERR(0, 161, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_22load_table_info(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_tables); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_22load_table_info(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_tables) { - PyObject *__pyx_v__tables = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - char const *__pyx_t_3; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__11) - __Pyx_RefNannySetupContext("load_table_info", 0); - __Pyx_TraceCall("load_table_info", __pyx_f[0], 161, 0, __PYX_ERR(0, 161, __pyx_L1_error)); - - /* "taos/_objects.pyx":163 - * def load_table_info(self, tables: list): - * # type: (str) -> None - * _tables = ",".join(tables).encode("utf-8") # <<<<<<<<<<<<<< - * taos_load_table_info(self._raw_conn, _tables) - * - */ - __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__12, __pyx_v_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v__tables = __pyx_t_2; - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":164 - * # type: (str) -> None - * _tables = ",".join(tables).encode("utf-8") - * taos_load_table_info(self._raw_conn, _tables) # <<<<<<<<<<<<<< - * - * def commit(self): - */ - __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v__tables); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error) - (void)(taos_load_table_info(__pyx_v_self->_raw_conn, __pyx_t_3)); - - /* "taos/_objects.pyx":161 - * print("tmq_conf_res:", tmq_conf_res) - * - * def load_table_info(self, tables: list): # <<<<<<<<<<<<<< - * # type: (str) -> None - * _tables = ",".join(tables).encode("utf-8") - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("taos._objects.TaosConnection.load_table_info", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__tables); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":166 - * taos_load_table_info(self._raw_conn, _tables) - * - * def commit(self): # <<<<<<<<<<<<<< - * """Commit any pending transaction to the database. - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_25commit(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_24commit, "TaosConnection.commit(self)\nCommit any pending transaction to the database.\n\n Since TDengine do not support transactions, the implement is void functionality.\n "); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_25commit = {"commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_25commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_24commit}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_25commit(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("commit (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("commit", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "commit", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_24commit(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_24commit(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__13) - __Pyx_RefNannySetupContext("commit", 0); - __Pyx_TraceCall("commit", __pyx_f[0], 166, 0, __PYX_ERR(0, 166, __pyx_L1_error)); - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.commit", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":173 - * pass - * - * def rollback(self): # <<<<<<<<<<<<<< - * """Void functionality""" - * pass - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_27rollback(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_26rollback, "TaosConnection.rollback(self)\nVoid functionality"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_27rollback = {"rollback", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_27rollback, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_26rollback}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_27rollback(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rollback (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("rollback", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rollback", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_26rollback(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_26rollback(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__14) - __Pyx_RefNannySetupContext("rollback", 0); - __Pyx_TraceCall("rollback", __pyx_f[0], 173, 0, __PYX_ERR(0, 173, __pyx_L1_error)); - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.rollback", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":177 - * pass - * - * def clear_result_set(self): # <<<<<<<<<<<<<< - * """Clear unused result set on this connection.""" - * pass - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_29clear_result_set(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_28clear_result_set, "TaosConnection.clear_result_set(self)\nClear unused result set on this connection."); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_29clear_result_set = {"clear_result_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_29clear_result_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_28clear_result_set}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_29clear_result_set(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("clear_result_set (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("clear_result_set", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear_result_set", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_28clear_result_set(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_28clear_result_set(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__15) - __Pyx_RefNannySetupContext("clear_result_set", 0); - __Pyx_TraceCall("clear_result_set", __pyx_f[0], 177, 0, __PYX_ERR(0, 177, __pyx_L1_error)); - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.clear_result_set", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":181 - * pass - * - * def get_table_vgroup_id(self, db: str, table: str): # <<<<<<<<<<<<<< - * # type: (str, str) -> int - * """ - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_31get_table_vgroup_id(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_30get_table_vgroup_id, "TaosConnection.get_table_vgroup_id(self, unicode db: str, unicode table: str)\n\n get table's vgroup id. It's require db name and table name, and return an int type vgroup id.\n "); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_31get_table_vgroup_id = {"get_table_vgroup_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_31get_table_vgroup_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_30get_table_vgroup_id}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_31get_table_vgroup_id(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_db = 0; - PyObject *__pyx_v_table = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_table_vgroup_id (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_db,&__pyx_n_s_table,0}; - PyObject* values[2] = {0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_db)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_table)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("get_table_vgroup_id", 1, 2, 2, 1); __PYX_ERR(0, 181, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_table_vgroup_id") < 0)) __PYX_ERR(0, 181, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_db = ((PyObject*)values[0]); - __pyx_v_table = ((PyObject*)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_table_vgroup_id", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 181, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.get_table_vgroup_id", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_db), (&PyUnicode_Type), 0, "db", 1))) __PYX_ERR(0, 181, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), (&PyUnicode_Type), 0, "table", 1))) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_30get_table_vgroup_id(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v_db, __pyx_v_table); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_30get_table_vgroup_id(struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, PyObject *__pyx_v_db, PyObject *__pyx_v_table) { - int __pyx_v_vg_id; - PyObject *__pyx_v__db = NULL; - PyObject *__pyx_v__table = NULL; - int __pyx_v_code; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - char const *__pyx_t_2; - char const *__pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__16) - __Pyx_RefNannySetupContext("get_table_vgroup_id", 0); - __Pyx_TraceCall("get_table_vgroup_id", __pyx_f[0], 181, 0, __PYX_ERR(0, 181, __pyx_L1_error)); - - /* "taos/_objects.pyx":187 - * """ - * cdef int vg_id - * _db = db.encode("utf-8") # <<<<<<<<<<<<<< - * _table = table.encode("utf-8") - * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_db); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__db = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":188 - * cdef int vg_id - * _db = db.encode("utf-8") - * _table = table.encode("utf-8") # <<<<<<<<<<<<<< - * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) - * if code != 0: - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__table = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":189 - * _db = db.encode("utf-8") - * _table = table.encode("utf-8") - * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) # <<<<<<<<<<<<<< - * if code != 0: - * raise InternalError(taos_errstr(NULL)) - */ - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__db); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v__table); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) - __pyx_v_code = taos_get_table_vgId(__pyx_v_self->_raw_conn, __pyx_t_2, __pyx_t_3, (&__pyx_v_vg_id)); - - /* "taos/_objects.pyx":190 - * _table = table.encode("utf-8") - * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) - * if code != 0: # <<<<<<<<<<<<<< - * raise InternalError(taos_errstr(NULL)) - * return vg_id - */ - __pyx_t_4 = (__pyx_v_code != 0); - if (unlikely(__pyx_t_4)) { - - /* "taos/_objects.pyx":191 - * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) - * if code != 0: - * raise InternalError(taos_errstr(NULL)) # <<<<<<<<<<<<<< - * return vg_id - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_InternalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(taos_errstr(NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 191, __pyx_L1_error) - - /* "taos/_objects.pyx":190 - * _table = table.encode("utf-8") - * code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) - * if code != 0: # <<<<<<<<<<<<<< - * raise InternalError(taos_errstr(NULL)) - * return vg_id - */ - } - - /* "taos/_objects.pyx":192 - * if code != 0: - * raise InternalError(taos_errstr(NULL)) - * return vg_id # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_vg_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":181 - * pass - * - * def get_table_vgroup_id(self, db: str, table: str): # <<<<<<<<<<<<<< - * # type: (str, str) -> int - * """ - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("taos._objects.TaosConnection.get_table_vgroup_id", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__db); - __Pyx_XDECREF(__pyx_v__table); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_33__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_32__reduce_cython__, "TaosConnection.__reduce_cython__(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_32__reduce_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_33__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_32__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__17) - __Pyx_RefNannySetupContext("__reduce_cython__", 0); - __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); - - /* "(tree fragment)":2 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 2, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_35__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_14TaosConnection_34__setstate_cython__, "TaosConnection.__setstate_cython__(self, __pyx_state)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_14TaosConnection_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_34__setstate_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_14TaosConnection_35__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v___pyx_state = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_14TaosConnection_34__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_v_self), __pyx_v___pyx_state); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_14TaosConnection_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__18) - __Pyx_RefNannySetupContext("__setstate_cython__", 0); - __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); - - /* "(tree fragment)":4 - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 4, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosConnection.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":200 - * cdef int32_t _bytes - * - * def __cinit__(self, str name, int8_t type_, int32_t bytes): # <<<<<<<<<<<<<< - * self._name = name - * self._type = type_ - */ - -/* Python wrapper */ -static int __pyx_pw_4taos_8_objects_9TaosField_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_4taos_8_objects_9TaosField_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_name = 0; - int8_t __pyx_v_type_; - int32_t __pyx_v_bytes; - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_type,&__pyx_n_s_bytes,0}; - PyObject* values[3] = {0,0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_type)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 200, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bytes)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 200, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 200, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); - values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); - } - __pyx_v_name = ((PyObject*)values[0]); - __pyx_v_type_ = __Pyx_PyInt_As_int8_t(values[1]); if (unlikely((__pyx_v_type_ == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) - __pyx_v_bytes = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_bytes == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 200, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosField.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 200, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField___cinit__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self), __pyx_v_name, __pyx_v_type_, __pyx_v_bytes); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4taos_8_objects_9TaosField___cinit__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, PyObject *__pyx_v_name, int8_t __pyx_v_type_, int32_t __pyx_v_bytes) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); - __Pyx_TraceCall("__cinit__", __pyx_f[0], 200, 0, __PYX_ERR(0, 200, __pyx_L1_error)); - - /* "taos/_objects.pyx":201 - * - * def __cinit__(self, str name, int8_t type_, int32_t bytes): - * self._name = name # <<<<<<<<<<<<<< - * self._type = type_ - * self._bytes = bytes - */ - __Pyx_INCREF(__pyx_v_name); - __Pyx_GIVEREF(__pyx_v_name); - __Pyx_GOTREF(__pyx_v_self->_name); - __Pyx_DECREF(__pyx_v_self->_name); - __pyx_v_self->_name = __pyx_v_name; - - /* "taos/_objects.pyx":202 - * def __cinit__(self, str name, int8_t type_, int32_t bytes): - * self._name = name - * self._type = type_ # <<<<<<<<<<<<<< - * self._bytes = bytes - * - */ - __pyx_v_self->_type = __pyx_v_type_; - - /* "taos/_objects.pyx":203 - * self._name = name - * self._type = type_ - * self._bytes = bytes # <<<<<<<<<<<<<< - * - * @property - */ - __pyx_v_self->_bytes = __pyx_v_bytes; - - /* "taos/_objects.pyx":200 - * cdef int32_t _bytes - * - * def __cinit__(self, str name, int8_t type_, int32_t bytes): # <<<<<<<<<<<<<< - * self._name = name - * self._type = type_ - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosField.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":205 - * self._bytes = bytes - * - * @property # <<<<<<<<<<<<<< - * def name(self): - * return self._name - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_4name_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_4name___get__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4name___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 205, 0, __PYX_ERR(0, 205, __pyx_L1_error)); - - /* "taos/_objects.pyx":207 - * @property - * def name(self): - * return self._name # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->_name); - __pyx_r = __pyx_v_self->_name; - goto __pyx_L0; - - /* "taos/_objects.pyx":205 - * self._bytes = bytes - * - * @property # <<<<<<<<<<<<<< - * def name(self): - * return self._name - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosField.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":209 - * return self._name - * - * @property # <<<<<<<<<<<<<< - * def type(self): - * return self._type - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_4type_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_4type_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_4type___get__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4type___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 209, 0, __PYX_ERR(0, 209, __pyx_L1_error)); - - /* "taos/_objects.pyx":211 - * @property - * def type(self): - * return self._type # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_self->_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":209 - * return self._name - * - * @property # <<<<<<<<<<<<<< - * def type(self): - * return self._type - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosField.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":213 - * return self._type - * - * @property # <<<<<<<<<<<<<< - * def bytes(self): - * return self._bytes - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_5bytes_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_5bytes_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_5bytes___get__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_5bytes___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 213, 0, __PYX_ERR(0, 213, __pyx_L1_error)); - - /* "taos/_objects.pyx":215 - * @property - * def bytes(self): - * return self._bytes # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":213 - * return self._type - * - * @property # <<<<<<<<<<<<<< - * def bytes(self): - * return self._bytes - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosField.bytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":217 - * return self._bytes - * - * @property # <<<<<<<<<<<<<< - * def length(self): - * return self._bytes - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_6length_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_6length_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_6length___get__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_6length___get__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 217, 0, __PYX_ERR(0, 217, __pyx_L1_error)); - - /* "taos/_objects.pyx":219 - * @property - * def length(self): - * return self._bytes # <<<<<<<<<<<<<< - * - * def __str__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":217 - * return self._bytes - * - * @property # <<<<<<<<<<<<<< - * def length(self): - * return self._bytes - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosField.length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":221 - * return self._bytes - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_3__str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_3__str__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_2__str__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_2__str__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_UCS4 __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__str__", 0); - __Pyx_TraceCall("__str__", __pyx_f[0], 221, 0, __PYX_ERR(0, 221, __pyx_L1_error)); - - /* "taos/_objects.pyx":222 - * - * def __str__(self): - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_TaosField_name); - __pyx_t_2 += 16; - __Pyx_GIVEREF(__pyx_kp_u_TaosField_name); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TaosField_name); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u_type_2); - __pyx_t_2 += 8; - __Pyx_GIVEREF(__pyx_kp_u_type_2); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_type_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_5), __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u_bytes_2); - __pyx_t_2 += 9; - __Pyx_GIVEREF(__pyx_kp_u_bytes_2); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_bytes_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_4), __pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__19); - __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__19); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__19); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":221 - * return self._bytes - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("taos._objects.TaosField.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":224 - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_5__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_5__repr__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_4__repr__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_4__repr__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_UCS4 __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__repr__", 0); - __Pyx_TraceCall("__repr__", __pyx_f[0], 224, 0, __PYX_ERR(0, 224, __pyx_L1_error)); - - /* "taos/_objects.pyx":225 - * - * def __repr__(self): - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) # <<<<<<<<<<<<<< - * - * def __getitem__(self, item): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_TaosField_name); - __pyx_t_2 += 16; - __Pyx_GIVEREF(__pyx_kp_u_TaosField_name); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TaosField_name); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u_type_2); - __pyx_t_2 += 8; - __Pyx_GIVEREF(__pyx_kp_u_type_2); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_type_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_5), __pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u_bytes_2); - __pyx_t_2 += 9; - __Pyx_GIVEREF(__pyx_kp_u_bytes_2); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_bytes_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_4), __pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__19); - __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__19); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__19); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":224 - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("taos._objects.TaosField.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":227 - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - * - * def __getitem__(self, item): # <<<<<<<<<<<<<< - * return getattr(self, item) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_6__getitem__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self), ((PyObject *)__pyx_v_item)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_6__getitem__(struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, PyObject *__pyx_v_item) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getitem__", 0); - __Pyx_TraceCall("__getitem__", __pyx_f[0], 227, 0, __PYX_ERR(0, 227, __pyx_L1_error)); - - /* "taos/_objects.pyx":228 - * - * def __getitem__(self, item): - * return getattr(self, item) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetAttr(((PyObject *)__pyx_v_self), __pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":227 - * return "TaosField{name: %s, type: %d, bytes: %d}" % (self.name, self.type, self.bytes) - * - * def __getitem__(self, item): # <<<<<<<<<<<<<< - * return getattr(self, item) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosField.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_9__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_9TaosField_8__reduce_cython__, "TaosField.__reduce_cython__(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_9TaosField_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_9TaosField_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_9TaosField_8__reduce_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_9__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_8__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__20) - __Pyx_RefNannySetupContext("__reduce_cython__", 0); - __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); - - /* "(tree fragment)":2 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 2, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosField.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_11__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_9TaosField_10__setstate_cython__, "TaosField.__setstate_cython__(self, __pyx_state)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_9TaosField_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_9TaosField_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_9TaosField_10__setstate_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_9TaosField_11__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v___pyx_state = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosField.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_9TaosField_10__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosField *)__pyx_v_self), __pyx_v___pyx_state); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_9TaosField_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosField *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__21) - __Pyx_RefNannySetupContext("__setstate_cython__", 0); - __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); - - /* "(tree fragment)":4 - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 4, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosField.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":239 - * cdef int _affected_rows - * - * def __cinit__(self, size_t res): # <<<<<<<<<<<<<< - * self._res = res - * self._check_result_error() - */ - -/* Python wrapper */ -static int __pyx_pw_4taos_8_objects_10TaosResult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_4taos_8_objects_10TaosResult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - size_t __pyx_v_res; - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_res,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_res)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 239, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - } - __pyx_v_res = __Pyx_PyInt_As_size_t(values[0]); if (unlikely((__pyx_v_res == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 239, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult___cinit__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self), __pyx_v_res); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4taos_8_objects_10TaosResult___cinit__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, size_t __pyx_v_res) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); - __Pyx_TraceCall("__cinit__", __pyx_f[0], 239, 0, __PYX_ERR(0, 239, __pyx_L1_error)); - - /* "taos/_objects.pyx":240 - * - * def __cinit__(self, size_t res): - * self._res = res # <<<<<<<<<<<<<< - * self._check_result_error() - * self._field_count = taos_field_count(self._res) - */ - __pyx_v_self->_res = ((TAOS_RES *)__pyx_v_res); - - /* "taos/_objects.pyx":241 - * def __cinit__(self, size_t res): - * self._res = res - * self._check_result_error() # <<<<<<<<<<<<<< - * self._field_count = taos_field_count(self._res) - * self._fields = taos_fetch_fields(self._res) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_result_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_objects.pyx":242 - * self._res = res - * self._check_result_error() - * self._field_count = taos_field_count(self._res) # <<<<<<<<<<<<<< - * self._fields = taos_fetch_fields(self._res) - * self._precision = taos_result_precision(self._res) - */ - __pyx_v_self->_field_count = taos_field_count(__pyx_v_self->_res); - - /* "taos/_objects.pyx":243 - * self._check_result_error() - * self._field_count = taos_field_count(self._res) - * self._fields = taos_fetch_fields(self._res) # <<<<<<<<<<<<<< - * self._precision = taos_result_precision(self._res) - * self._affected_rows = taos_affected_rows(self._res) - */ - __pyx_v_self->_fields = taos_fetch_fields(__pyx_v_self->_res); - - /* "taos/_objects.pyx":244 - * self._field_count = taos_field_count(self._res) - * self._fields = taos_fetch_fields(self._res) - * self._precision = taos_result_precision(self._res) # <<<<<<<<<<<<<< - * self._affected_rows = taos_affected_rows(self._res) - * self._row_count = 0 - */ - __pyx_v_self->_precision = taos_result_precision(__pyx_v_self->_res); - - /* "taos/_objects.pyx":245 - * self._fields = taos_fetch_fields(self._res) - * self._precision = taos_result_precision(self._res) - * self._affected_rows = taos_affected_rows(self._res) # <<<<<<<<<<<<<< - * self._row_count = 0 - * - */ - __pyx_v_self->_affected_rows = taos_affected_rows(__pyx_v_self->_res); - - /* "taos/_objects.pyx":246 - * self._precision = taos_result_precision(self._res) - * self._affected_rows = taos_affected_rows(self._res) - * self._row_count = 0 # <<<<<<<<<<<<<< - * - * def __str__(self): - */ - __pyx_v_self->_row_count = 0; - - /* "taos/_objects.pyx":239 - * cdef int _affected_rows - * - * def __cinit__(self, size_t res): # <<<<<<<<<<<<<< - * self._res = res - * self._check_result_error() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("taos._objects.TaosResult.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":248 - * self._row_count = 0 - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "TaosResult{res: %s}" % (self._res, ) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_3__str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_3__str__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_2__str__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_2__str__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_UCS4 __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__str__", 0); - __Pyx_TraceCall("__str__", __pyx_f[0], 248, 0, __PYX_ERR(0, 248, __pyx_L1_error)); - - /* "taos/_objects.pyx":249 - * - * def __str__(self): - * return "TaosResult{res: %s}" % (self._res, ) # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_TaosResult_res); - __pyx_t_2 += 16; - __Pyx_GIVEREF(__pyx_kp_u_TaosResult_res); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TaosResult_res); - __pyx_t_4 = __Pyx_PyUnicode_From_size_t(((size_t)__pyx_v_self->_res), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__19); - __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__19); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":248 - * self._row_count = 0 - * - * def __str__(self): # <<<<<<<<<<<<<< - * return "TaosResult{res: %s}" % (self._res, ) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("taos._objects.TaosResult.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":251 - * return "TaosResult{res: %s}" % (self._res, ) - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "TaosResult{res: %s}" % (self._res, ) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_5__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_5__repr__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_4__repr__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_4__repr__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_UCS4 __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__repr__", 0); - __Pyx_TraceCall("__repr__", __pyx_f[0], 251, 0, __PYX_ERR(0, 251, __pyx_L1_error)); - - /* "taos/_objects.pyx":252 - * - * def __repr__(self): - * return "TaosResult{res: %s}" % (self._res, ) # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_TaosResult_res); - __pyx_t_2 += 16; - __Pyx_GIVEREF(__pyx_kp_u_TaosResult_res); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TaosResult_res); - __pyx_t_4 = __Pyx_PyUnicode_From_size_t(((size_t)__pyx_v_self->_res), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__19); - __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__19); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":251 - * return "TaosResult{res: %s}" % (self._res, ) - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "TaosResult{res: %s}" % (self._res, ) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("taos._objects.TaosResult.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":254 - * return "TaosResult{res: %s}" % (self._res, ) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self.rows_iter() - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_7__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_7__iter__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_6__iter__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_6__iter__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__iter__", 0); - __Pyx_TraceCall("__iter__", __pyx_f[0], 254, 0, __PYX_ERR(0, 254, __pyx_L1_error)); - - /* "taos/_objects.pyx":255 - * - * def __iter__(self): - * return self.rows_iter() # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rows_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":254 - * return "TaosResult{res: %s}" % (self._res, ) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self.rows_iter() - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("taos._objects.TaosResult.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":257 - * return self.rows_iter() - * - * @property # <<<<<<<<<<<<<< - * def fields(self): - * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_6fields_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_6fields_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_6fields___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_6fields___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - TAOS_FIELD __pyx_8genexpr1__pyx_v_f; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - TAOS_FIELD *__pyx_t_2; - TAOS_FIELD *__pyx_t_3; - TAOS_FIELD *__pyx_t_4; - char *__pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 257, 0, __PYX_ERR(0, 257, __pyx_L1_error)); - - /* "taos/_objects.pyx":259 - * @property - * def fields(self): - * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__pyx_v_self->_fields + __pyx_v_self->_field_count); - for (__pyx_t_4 = __pyx_v_self->_fields; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { - __pyx_t_2 = __pyx_t_4; - __pyx_8genexpr1__pyx_v_f = (__pyx_t_2[0]); - __pyx_t_5 = __pyx_8genexpr1__pyx_v_f.name; - __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_5, 0, strlen(__pyx_t_5), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_int8_t(__pyx_8genexpr1__pyx_v_f.type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_8genexpr1__pyx_v_f.bytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4taos_8_objects_TaosField), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - } /* exit inner scope */ - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":257 - * return self.rows_iter() - * - * @property # <<<<<<<<<<<<<< - * def fields(self): - * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("taos._objects.TaosResult.fields.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":261 - * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] - * - * @property # <<<<<<<<<<<<<< - * def field_count(self): - * return self._field_count - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_11field_count_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_11field_count_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_11field_count___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_11field_count___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error)); - - /* "taos/_objects.pyx":263 - * @property - * def field_count(self): - * return self._field_count # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_field_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":261 - * return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] - * - * @property # <<<<<<<<<<<<<< - * def field_count(self): - * return self._field_count - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosResult.field_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":265 - * return self._field_count - * - * @property # <<<<<<<<<<<<<< - * def precision(self): - * return self._precision - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9precision_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9precision_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_9precision___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_9precision___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 265, 0, __PYX_ERR(0, 265, __pyx_L1_error)); - - /* "taos/_objects.pyx":267 - * @property - * def precision(self): - * return self._precision # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_precision); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":265 - * return self._field_count - * - * @property # <<<<<<<<<<<<<< - * def precision(self): - * return self._precision - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosResult.precision.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":269 - * return self._precision - * - * @property # <<<<<<<<<<<<<< - * def affected_rows(self): - * return self._affected_rows - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_13affected_rows_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_13affected_rows_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_13affected_rows___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_13affected_rows___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 269, 0, __PYX_ERR(0, 269, __pyx_L1_error)); - - /* "taos/_objects.pyx":271 - * @property - * def affected_rows(self): - * return self._affected_rows # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_affected_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":269 - * return self._precision - * - * @property # <<<<<<<<<<<<<< - * def affected_rows(self): - * return self._affected_rows - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosResult.affected_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":273 - * return self._affected_rows - * - * @property # <<<<<<<<<<<<<< - * def row_count(self): - * return self._row_count - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9row_count_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9row_count_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_9row_count___get__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_9row_count___get__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 273, 0, __PYX_ERR(0, 273, __pyx_L1_error)); - - /* "taos/_objects.pyx":275 - * @property - * def row_count(self): - * return self._row_count # <<<<<<<<<<<<<< - * - * def _check_result_error(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_row_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":273 - * return self._affected_rows - * - * @property # <<<<<<<<<<<<<< - * def row_count(self): - * return self._row_count - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosResult.row_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":277 - * return self._row_count - * - * def _check_result_error(self): # <<<<<<<<<<<<<< - * errno = taos_errno(self._res) - * if errno != 0: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9_check_result_error(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_8_check_result_error, "TaosResult._check_result_error(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_9_check_result_error = {"_check_result_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_9_check_result_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_8_check_result_error}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_9_check_result_error(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_check_result_error (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("_check_result_error", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_check_result_error", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_8_check_result_error(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_8_check_result_error(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - int __pyx_v_errno; - char *__pyx_v_errstr; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__22) - __Pyx_RefNannySetupContext("_check_result_error", 0); - __Pyx_TraceCall("_check_result_error", __pyx_f[0], 277, 0, __PYX_ERR(0, 277, __pyx_L1_error)); - - /* "taos/_objects.pyx":278 - * - * def _check_result_error(self): - * errno = taos_errno(self._res) # <<<<<<<<<<<<<< - * if errno != 0: - * errstr = taos_errstr(self._res) - */ - __pyx_v_errno = taos_errno(__pyx_v_self->_res); - - /* "taos/_objects.pyx":279 - * def _check_result_error(self): - * errno = taos_errno(self._res) - * if errno != 0: # <<<<<<<<<<<<<< - * errstr = taos_errstr(self._res) - * raise ProgrammingError(errstr, errno) - */ - __pyx_t_1 = (__pyx_v_errno != 0); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":280 - * errno = taos_errno(self._res) - * if errno != 0: - * errstr = taos_errstr(self._res) # <<<<<<<<<<<<<< - * raise ProgrammingError(errstr, errno) - * - */ - __pyx_v_errstr = taos_errstr(__pyx_v_self->_res); - - /* "taos/_objects.pyx":281 - * if errno != 0: - * errstr = taos_errstr(self._res) - * raise ProgrammingError(errstr, errno) # <<<<<<<<<<<<<< - * - * def _fetch_block(self): - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_errstr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 281, __pyx_L1_error) - - /* "taos/_objects.pyx":279 - * def _check_result_error(self): - * errno = taos_errno(self._res) - * if errno != 0: # <<<<<<<<<<<<<< - * errstr = taos_errstr(self._res) - * raise ProgrammingError(errstr, errno) - */ - } - - /* "taos/_objects.pyx":277 - * return self._row_count - * - * def _check_result_error(self): # <<<<<<<<<<<<<< - * errno = taos_errno(self._res) - * if errno != 0: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("taos._objects.TaosResult._check_result_error", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":283 - * raise ProgrammingError(errstr, errno) - * - * def _fetch_block(self): # <<<<<<<<<<<<<< - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(self._res, &pblock) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_11_fetch_block(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_10_fetch_block, "TaosResult._fetch_block(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_11_fetch_block = {"_fetch_block", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_11_fetch_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_10_fetch_block}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_11_fetch_block(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_fetch_block (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("_fetch_block", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_fetch_block", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_10_fetch_block(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_10_fetch_block(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - TAOS_ROW __pyx_v_pblock; - PyObject *__pyx_v_num_of_rows = NULL; - PyObject *__pyx_v_blocks = NULL; - PyObject *__pyx_v_dt_epoch = NULL; - int __pyx_v_i; - void *__pyx_v_data; - TAOS_FIELD __pyx_v_field; - int *__pyx_v_offsets; - PyObject *__pyx_v_is_null = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int8_t __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__23) - __Pyx_RefNannySetupContext("_fetch_block", 0); - __Pyx_TraceCall("_fetch_block", __pyx_f[0], 283, 0, __PYX_ERR(0, 283, __pyx_L1_error)); - - /* "taos/_objects.pyx":285 - * def _fetch_block(self): - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(self._res, &pblock) # <<<<<<<<<<<<<< - * if num_of_rows == 0: - * return [], 0 - */ - __pyx_t_1 = __Pyx_PyInt_From_int(taos_fetch_block(__pyx_v_self->_res, (&__pyx_v_pblock))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_num_of_rows = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":286 - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(self._res, &pblock) - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * return [], 0 - * - */ - __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) - if (__pyx_t_2) { - - /* "taos/_objects.pyx":287 - * num_of_rows = taos_fetch_block(self._res, &pblock) - * if num_of_rows == 0: - * return [], 0 # <<<<<<<<<<<<<< - * - * blocks = [None] * self._field_count - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":286 - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(self._res, &pblock) - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * return [], 0 - * - */ - } - - /* "taos/_objects.pyx":289 - * return [], 0 - * - * blocks = [None] * self._field_count # <<<<<<<<<<<<<< - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - * cdef int i - */ - __pyx_t_3 = PyList_New(1 * ((__pyx_v_self->_field_count<0) ? 0:__pyx_v_self->_field_count)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < __pyx_v_self->_field_count; __pyx_temp++) { - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None); - } - } - __pyx_v_blocks = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "taos/_objects.pyx":290 - * - * blocks = [None] * self._field_count - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch # <<<<<<<<<<<<<< - * cdef int i - * for i in range(self._field_count): - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_t_1; - __pyx_t_1 = 0; - } else { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_t_1; - __pyx_t_1 = 0; - } - __pyx_v_dt_epoch = __pyx_t_3; - __pyx_t_3 = 0; - - /* "taos/_objects.pyx":292 - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - * cdef int i - * for i in range(self._field_count): # <<<<<<<<<<<<<< - * data = pblock[i] - * field = self._fields[i] - */ - __pyx_t_4 = __pyx_v_self->_field_count; - __pyx_t_5 = __pyx_t_4; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { - __pyx_v_i = __pyx_t_6; - - /* "taos/_objects.pyx":293 - * cdef int i - * for i in range(self._field_count): - * data = pblock[i] # <<<<<<<<<<<<<< - * field = self._fields[i] - * - */ - __pyx_v_data = (__pyx_v_pblock[__pyx_v_i]); - - /* "taos/_objects.pyx":294 - * for i in range(self._field_count): - * data = pblock[i] - * field = self._fields[i] # <<<<<<<<<<<<<< - * - * if field.type in UNSIZED_TYPE: - */ - __pyx_v_field = (__pyx_v_self->_fields[__pyx_v_i]); - - /* "taos/_objects.pyx":296 - * field = self._fields[i] - * - * if field.type in UNSIZED_TYPE: # <<<<<<<<<<<<<< - * offsets = taos_get_column_data_offset(self._res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) - */ - __pyx_t_3 = __Pyx_PyInt_From_int8_t(__pyx_v_field.type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_UNSIZED_TYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "taos/_objects.pyx":297 - * - * if field.type in UNSIZED_TYPE: - * offsets = taos_get_column_data_offset(self._res, i) # <<<<<<<<<<<<<< - * blocks[i] = _parse_string(data, num_of_rows, offsets) - * elif field.type in SIZED_TYPE: - */ - __pyx_v_offsets = taos_get_column_data_offset(__pyx_v_self->_res, __pyx_v_i); - - /* "taos/_objects.pyx":298 - * if field.type in UNSIZED_TYPE: - * offsets = taos_get_column_data_offset(self._res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) # <<<<<<<<<<<<<< - * elif field.type in SIZED_TYPE: - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error) - __pyx_t_1 = __pyx_f_4taos_7_parser__parse_string(((size_t)__pyx_v_data), __pyx_t_7, __pyx_v_offsets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_objects.pyx":296 - * field = self._fields[i] - * - * if field.type in UNSIZED_TYPE: # <<<<<<<<<<<<<< - * offsets = taos_get_column_data_offset(self._res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) - */ - goto __pyx_L6; - } - - /* "taos/_objects.pyx":299 - * offsets = taos_get_column_data_offset(self._res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) - * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - */ - __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_field.type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "taos/_objects.pyx":300 - * blocks[i] = _parse_string(data, num_of_rows, offsets) - * elif field.type in SIZED_TYPE: - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) # <<<<<<<<<<<<<< - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L1_error) - __pyx_t_3 = __pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(__pyx_v_self->_res, __pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_is_null, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "taos/_objects.pyx":301 - * elif field.type in SIZED_TYPE: - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) # <<<<<<<<<<<<<< - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CONVERT_FUNC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_field.type, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_1, __pyx_v_num_of_rows, __pyx_v_is_null}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":299 - * offsets = taos_get_column_data_offset(self._res, i) - * blocks[i] = _parse_string(data, num_of_rows, offsets) - * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - */ - goto __pyx_L6; - } - - /* "taos/_objects.pyx":302 - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) - */ - __pyx_t_10 = __pyx_v_field.type; - __pyx_t_2 = (__pyx_t_10 == TSDB_DATA_TYPE_TIMESTAMP); - if (__pyx_t_2) { - - /* "taos/_objects.pyx":303 - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) # <<<<<<<<<<<<<< - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) - * else: - */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L1_error) - __pyx_t_3 = __pyx_f_4taos_11_cinterface_taos_get_column_data_is_null(__pyx_v_self->_res, __pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_is_null, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "taos/_objects.pyx":304 - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) # <<<<<<<<<<<<<< - * else: - * pass - */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_num_of_rows); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error) - __pyx_t_3 = __pyx_f_4taos_7_parser__parse_timestamp(((size_t)__pyx_v_data), __pyx_t_7, __pyx_v_is_null, __pyx_v_self->_precision, __pyx_v_dt_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely((__Pyx_SetItemInt(__pyx_v_blocks, __pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 304, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":302 - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - * blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< - * is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) - */ - goto __pyx_L6; - } - - /* "taos/_objects.pyx":306 - * blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) - * else: - * pass # <<<<<<<<<<<<<< - * - * return blocks, abs(num_of_rows) - */ - /*else*/ { - } - __pyx_L6:; - } - - /* "taos/_objects.pyx":308 - * pass - * - * return blocks, abs(num_of_rows) # <<<<<<<<<<<<<< - * - * def fetch_block(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_v_num_of_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_v_blocks); - __Pyx_GIVEREF(__pyx_v_blocks); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_blocks); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":283 - * raise ProgrammingError(errstr, errno) - * - * def _fetch_block(self): # <<<<<<<<<<<<<< - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(self._res, &pblock) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("taos._objects.TaosResult._fetch_block", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_num_of_rows); - __Pyx_XDECREF(__pyx_v_blocks); - __Pyx_XDECREF(__pyx_v_dt_epoch); - __Pyx_XDECREF(__pyx_v_is_null); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":310 - * return blocks, abs(num_of_rows) - * - * def fetch_block(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetch iterator") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_13fetch_block(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_12fetch_block, "TaosResult.fetch_block(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_13fetch_block = {"fetch_block", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_13fetch_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_12fetch_block}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_13fetch_block(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fetch_block (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("fetch_block", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetch_block", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_12fetch_block(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_12fetch_block(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_v_block = NULL; - PyObject *__pyx_v_num_of_rows = NULL; - PyObject *__pyx_8genexpr2__pyx_v_r = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *(*__pyx_t_7)(PyObject *); - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__24) - __Pyx_RefNannySetupContext("fetch_block", 0); - __Pyx_TraceCall("fetch_block", __pyx_f[0], 310, 0, __PYX_ERR(0, 310, __pyx_L1_error)); - - /* "taos/_objects.pyx":311 - * - * def fetch_block(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of fetch iterator") - * - */ - __pyx_t_1 = (__pyx_v_self->_res == NULL); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":312 - * def fetch_block(self): - * if self._res is NULL: - * raise OperationalError("Invalid use of fetch iterator") # <<<<<<<<<<<<<< - * - * block, num_of_rows = self._fetch_block() - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_fetch_iterator}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 312, __pyx_L1_error) - - /* "taos/_objects.pyx":311 - * - * def fetch_block(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of fetch iterator") - * - */ - } - - /* "taos/_objects.pyx":314 - * raise OperationalError("Invalid use of fetch iterator") - * - * block, num_of_rows = self._fetch_block() # <<<<<<<<<<<<<< - * self._row_count += num_of_rows - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch_block); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 314, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_4 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 314, __pyx_L1_error) - __pyx_t_7 = NULL; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L5_unpacking_done; - __pyx_L4_unpacking_failed:; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 314, __pyx_L1_error) - __pyx_L5_unpacking_done:; - } - __pyx_v_block = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_num_of_rows = __pyx_t_4; - __pyx_t_4 = 0; - - /* "taos/_objects.pyx":315 - * - * block, num_of_rows = self._fetch_block() - * self._row_count += num_of_rows # <<<<<<<<<<<<<< - * - * return [r for r in map(tuple, zip(*block))], num_of_rows - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_row_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_num_of_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_self->_row_count = __pyx_t_5; - - /* "taos/_objects.pyx":317 - * self._row_count += num_of_rows - * - * return [r for r in map(tuple, zip(*block))], num_of_rows # <<<<<<<<<<<<<< - * - * def fetch_all(self): - */ - __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_block); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF((PyObject *)(&PyTuple_Type)); - __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; - __pyx_t_9 = NULL; - } else { - __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 317, __pyx_L8_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 317, __pyx_L8_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 317, __pyx_L8_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L8_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_9(__pyx_t_2); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 317, __pyx_L8_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_r, __pyx_t_3); - __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_8genexpr2__pyx_v_r))) __PYX_ERR(0, 317, __pyx_L8_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_r); __pyx_8genexpr2__pyx_v_r = 0; - goto __pyx_L12_exit_scope; - __pyx_L8_error:; - __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_r); __pyx_8genexpr2__pyx_v_r = 0; - goto __pyx_L1_error; - __pyx_L12_exit_scope:; - } /* exit inner scope */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); - __Pyx_INCREF(__pyx_v_num_of_rows); - __Pyx_GIVEREF(__pyx_v_num_of_rows); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_num_of_rows); - __pyx_t_4 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":310 - * return blocks, abs(num_of_rows) - * - * def fetch_block(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetch iterator") - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("taos._objects.TaosResult.fetch_block", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_block); - __Pyx_XDECREF(__pyx_v_num_of_rows); - __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_r); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":319 - * return [r for r in map(tuple, zip(*block))], num_of_rows - * - * def fetch_all(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_15fetch_all(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_14fetch_all, "TaosResult.fetch_all(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_15fetch_all = {"fetch_all", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_15fetch_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_14fetch_all}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_15fetch_all(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fetch_all (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("fetch_all", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetch_all", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_14fetch_all(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_14fetch_all(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_v_blocks = NULL; - PyObject *__pyx_v_block = NULL; - PyObject *__pyx_v_num_of_rows = NULL; - PyObject *__pyx_8genexpr3__pyx_v_b = NULL; - PyObject *__pyx_8genexpr3__pyx_v_r = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *(*__pyx_t_7)(PyObject *); - int __pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__25) - __Pyx_RefNannySetupContext("fetch_all", 0); - __Pyx_TraceCall("fetch_all", __pyx_f[0], 319, 0, __PYX_ERR(0, 319, __pyx_L1_error)); - - /* "taos/_objects.pyx":320 - * - * def fetch_all(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of fetchall") - * - */ - __pyx_t_1 = (__pyx_v_self->_res == NULL); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":321 - * def fetch_all(self): - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") # <<<<<<<<<<<<<< - * - * blocks = [] - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_fetchall}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 321, __pyx_L1_error) - - /* "taos/_objects.pyx":320 - * - * def fetch_all(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of fetchall") - * - */ - } - - /* "taos/_objects.pyx":323 - * raise OperationalError("Invalid use of fetchall") - * - * blocks = [] # <<<<<<<<<<<<<< - * while True: - * block, num_of_rows = self._fetch_block() - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_blocks = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":324 - * - * blocks = [] - * while True: # <<<<<<<<<<<<<< - * block, num_of_rows = self._fetch_block() - * self._check_result_error() - */ - while (1) { - - /* "taos/_objects.pyx":325 - * blocks = [] - * while True: - * block, num_of_rows = self._fetch_block() # <<<<<<<<<<<<<< - * self._check_result_error() - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch_block); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 325, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_4 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 325, __pyx_L1_error) - __pyx_t_7 = NULL; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L7_unpacking_done; - __pyx_L6_unpacking_failed:; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 325, __pyx_L1_error) - __pyx_L7_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_block, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_num_of_rows, __pyx_t_4); - __pyx_t_4 = 0; - - /* "taos/_objects.pyx":326 - * while True: - * block, num_of_rows = self._fetch_block() - * self._check_result_error() # <<<<<<<<<<<<<< - * - * if num_of_rows == 0: - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_result_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":328 - * self._check_result_error() - * - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * break - * - */ - __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":329 - * - * if num_of_rows == 0: - * break # <<<<<<<<<<<<<< - * - * self._row_count += num_of_rows - */ - goto __pyx_L5_break; - - /* "taos/_objects.pyx":328 - * self._check_result_error() - * - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * break - * - */ - } - - /* "taos/_objects.pyx":331 - * break - * - * self._row_count += num_of_rows # <<<<<<<<<<<<<< - * blocks.append(block) - * - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_row_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_num_of_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_self->_row_count = __pyx_t_5; - - /* "taos/_objects.pyx":332 - * - * self._row_count += num_of_rows - * blocks.append(block) # <<<<<<<<<<<<<< - * - * return [r for b in blocks for r in map(tuple, zip(*b))] - */ - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_blocks, __pyx_v_block); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 332, __pyx_L1_error) - } - __pyx_L5_break:; - - /* "taos/_objects.pyx":334 - * blocks.append(block) - * - * return [r for b in blocks for r in map(tuple, zip(*b))] # <<<<<<<<<<<<<< - * - * def fetch_all_into_dict(self): - */ - __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_v_blocks; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; - for (;;) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 334, __pyx_L11_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_b, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_8genexpr3__pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF((PyObject *)(&PyTuple_Type)); - __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { - __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; - __pyx_t_11 = NULL; - } else { - __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 334, __pyx_L11_error) - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 334, __pyx_L11_error) - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } else { - if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 334, __pyx_L11_error) - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } - } else { - __pyx_t_6 = __pyx_t_11(__pyx_t_3); - if (unlikely(!__pyx_t_6)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 334, __pyx_L11_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_6); - } - __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_r, __pyx_t_6); - __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_8genexpr3__pyx_v_r))) __PYX_ERR(0, 334, __pyx_L11_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_b); __pyx_8genexpr3__pyx_v_b = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_r); __pyx_8genexpr3__pyx_v_r = 0; - goto __pyx_L18_exit_scope; - __pyx_L11_error:; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_b); __pyx_8genexpr3__pyx_v_b = 0; - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_r); __pyx_8genexpr3__pyx_v_r = 0; - goto __pyx_L1_error; - __pyx_L18_exit_scope:; - } /* exit inner scope */ - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":319 - * return [r for r in map(tuple, zip(*block))], num_of_rows - * - * def fetch_all(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("taos._objects.TaosResult.fetch_all", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_blocks); - __Pyx_XDECREF(__pyx_v_block); - __Pyx_XDECREF(__pyx_v_num_of_rows); - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_b); - __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_r); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":336 - * return [r for b in blocks for r in map(tuple, zip(*b))] - * - * def fetch_all_into_dict(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_17fetch_all_into_dict(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_16fetch_all_into_dict, "TaosResult.fetch_all_into_dict(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_17fetch_all_into_dict = {"fetch_all_into_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_17fetch_all_into_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_16fetch_all_into_dict}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_17fetch_all_into_dict(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fetch_all_into_dict (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("fetch_all_into_dict", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetch_all_into_dict", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_16fetch_all_into_dict(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_16fetch_all_into_dict(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_v_field_names = NULL; - PyObject *__pyx_v_dict_row_cls = NULL; - PyObject *__pyx_v_blocks = NULL; - PyObject *__pyx_v_block = NULL; - PyObject *__pyx_v_num_of_rows = NULL; - PyObject *__pyx_8genexpr4__pyx_v_field = NULL; - PyObject *__pyx_8genexpr5__pyx_v_b = NULL; - PyObject *__pyx_8genexpr5__pyx_v_r = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - PyObject *__pyx_t_8 = NULL; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_t_10; - Py_ssize_t __pyx_t_11; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__26) - __Pyx_RefNannySetupContext("fetch_all_into_dict", 0); - __Pyx_TraceCall("fetch_all_into_dict", __pyx_f[0], 336, 0, __PYX_ERR(0, 336, __pyx_L1_error)); - - /* "taos/_objects.pyx":337 - * - * def fetch_all_into_dict(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of fetchall") - * - */ - __pyx_t_1 = (__pyx_v_self->_res == NULL); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":338 - * def fetch_all_into_dict(self): - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") # <<<<<<<<<<<<<< - * - * field_names = [field.name for field in self.fields] - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_fetchall}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 338, __pyx_L1_error) - - /* "taos/_objects.pyx":337 - * - * def fetch_all_into_dict(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of fetchall") - * - */ - } - - /* "taos/_objects.pyx":340 - * raise OperationalError("Invalid use of fetchall") - * - * field_names = [field.name for field in self.fields] # <<<<<<<<<<<<<< - * dict_row_cls = namedtuple('DictRow', field_names) - * blocks = [] - */ - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L6_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L6_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L6_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 340, __pyx_L6_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_field, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr4__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 340, __pyx_L6_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_field); __pyx_8genexpr4__pyx_v_field = 0; - goto __pyx_L10_exit_scope; - __pyx_L6_error:; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_field); __pyx_8genexpr4__pyx_v_field = 0; - goto __pyx_L1_error; - __pyx_L10_exit_scope:; - } /* exit inner scope */ - __pyx_v_field_names = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":341 - * - * field_names = [field.name for field in self.fields] - * dict_row_cls = namedtuple('DictRow', field_names) # <<<<<<<<<<<<<< - * blocks = [] - * while True: - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_n_u_DictRow, __pyx_v_field_names}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_v_dict_row_cls = __pyx_t_2; - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":342 - * field_names = [field.name for field in self.fields] - * dict_row_cls = namedtuple('DictRow', field_names) - * blocks = [] # <<<<<<<<<<<<<< - * while True: - * block, num_of_rows = self._fetch_block() - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_blocks = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":343 - * dict_row_cls = namedtuple('DictRow', field_names) - * blocks = [] - * while True: # <<<<<<<<<<<<<< - * block, num_of_rows = self._fetch_block() - * self._check_result_error() - */ - while (1) { - - /* "taos/_objects.pyx":344 - * blocks = [] - * while True: - * block, num_of_rows = self._fetch_block() # <<<<<<<<<<<<<< - * self._check_result_error() - * - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch_block); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 344, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); - index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L13_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L13_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L14_unpacking_done; - __pyx_L13_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 344, __pyx_L1_error) - __pyx_L14_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_block, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_num_of_rows, __pyx_t_3); - __pyx_t_3 = 0; - - /* "taos/_objects.pyx":345 - * while True: - * block, num_of_rows = self._fetch_block() - * self._check_result_error() # <<<<<<<<<<<<<< - * - * if num_of_rows == 0: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_result_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":347 - * self._check_result_error() - * - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * break - * - */ - __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":348 - * - * if num_of_rows == 0: - * break # <<<<<<<<<<<<<< - * - * self._row_count += num_of_rows - */ - goto __pyx_L12_break; - - /* "taos/_objects.pyx":347 - * self._check_result_error() - * - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * break - * - */ - } - - /* "taos/_objects.pyx":350 - * break - * - * self._row_count += num_of_rows # <<<<<<<<<<<<<< - * blocks.append(block) - * - */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_row_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_num_of_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_self->_row_count = __pyx_t_5; - - /* "taos/_objects.pyx":351 - * - * self._row_count += num_of_rows - * blocks.append(block) # <<<<<<<<<<<<<< - * - * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] - */ - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_blocks, __pyx_v_block); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 351, __pyx_L1_error) - } - __pyx_L12_break:; - - /* "taos/_objects.pyx":353 - * blocks.append(block) - * - * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] # <<<<<<<<<<<<<< - * - * def rows_iter(self): - */ - __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_v_blocks; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; - for (;;) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 353, __pyx_L18_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_b, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_8genexpr5__pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF((PyObject *)(&PyTuple_Type)); - __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L18_error) - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 353, __pyx_L18_error) - #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_8); - #endif - } else { - if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 353, __pyx_L18_error) - #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_8); - #endif - } - } else { - __pyx_t_8 = __pyx_t_7(__pyx_t_4); - if (unlikely(!__pyx_t_8)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 353, __pyx_L18_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_8); - } - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_r, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_8genexpr5__pyx_v_r); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_v_dict_row_cls, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asdict); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_13); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_13, }; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 353, __pyx_L18_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_b); __pyx_8genexpr5__pyx_v_b = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_r); __pyx_8genexpr5__pyx_v_r = 0; - goto __pyx_L25_exit_scope; - __pyx_L18_error:; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_b); __pyx_8genexpr5__pyx_v_b = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_r); __pyx_8genexpr5__pyx_v_r = 0; - goto __pyx_L1_error; - __pyx_L25_exit_scope:; - } /* exit inner scope */ - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":336 - * return [r for b in blocks for r in map(tuple, zip(*b))] - * - * def fetch_all_into_dict(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_AddTraceback("taos._objects.TaosResult.fetch_all_into_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_field_names); - __Pyx_XDECREF(__pyx_v_dict_row_cls); - __Pyx_XDECREF(__pyx_v_blocks); - __Pyx_XDECREF(__pyx_v_block); - __Pyx_XDECREF(__pyx_v_num_of_rows); - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_field); - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_b); - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_r); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_4taos_8_objects_10TaosResult_20generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "taos/_objects.pyx":355 - * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] - * - * def rows_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_19rows_iter(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_18rows_iter, "TaosResult.rows_iter(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_19rows_iter = {"rows_iter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_19rows_iter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_18rows_iter}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_19rows_iter(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rows_iter (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("rows_iter", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rows_iter", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_18rows_iter(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_18rows_iter(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("rows_iter", 0); - __pyx_cur_scope = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter(__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 355, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_self = __pyx_v_self; - __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4taos_8_objects_10TaosResult_20generator, __pyx_codeobj__27, (PyObject *) __pyx_cur_scope, __pyx_n_s_rows_iter, __pyx_n_s_TaosResult_rows_iter, __pyx_n_s_taos__objects); if (unlikely(!gen)) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.rows_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_4taos_8_objects_10TaosResult_20generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *__pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int8_t __pyx_t_8; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rows_iter", 0); - __Pyx_TraceFrameInit(__pyx_codeobj__27) - __Pyx_TraceCall("rows_iter", __pyx_f[0], 355, 0, __PYX_ERR(0, 355, __pyx_L1_error)); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L15_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 355, __pyx_L1_error) - - /* "taos/_objects.pyx":356 - * - * def rows_iter(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of rows_iter") - * - */ - __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->_res == NULL); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":357 - * def rows_iter(self): - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") # <<<<<<<<<<<<<< - * - * cdef TAOS_ROW taos_row - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_rows_iter}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 357, __pyx_L1_error) - - /* "taos/_objects.pyx":356 - * - * def rows_iter(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of rows_iter") - * - */ - } - - /* "taos/_objects.pyx":361 - * cdef TAOS_ROW taos_row - * cdef int i - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch # <<<<<<<<<<<<<< - * is_null = [False] - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_priv_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime_epoch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - __pyx_t_3 = 0; - } - __Pyx_GIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_v_dt_epoch = __pyx_t_2; - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":362 - * cdef int i - * dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - * is_null = [False] # <<<<<<<<<<<<<< - * - * while True: - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(Py_False); - __Pyx_GIVEREF(Py_False); - PyList_SET_ITEM(__pyx_t_2, 0, Py_False); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_v_is_null = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":364 - * is_null = [False] - * - * while True: # <<<<<<<<<<<<<< - * taos_row = taos_fetch_row(self._res) - * if taos_row is NULL: - */ - while (1) { - - /* "taos/_objects.pyx":365 - * - * while True: - * taos_row = taos_fetch_row(self._res) # <<<<<<<<<<<<<< - * if taos_row is NULL: - * break - */ - __pyx_cur_scope->__pyx_v_taos_row = taos_fetch_row(__pyx_cur_scope->__pyx_v_self->_res); - - /* "taos/_objects.pyx":366 - * while True: - * taos_row = taos_fetch_row(self._res) - * if taos_row is NULL: # <<<<<<<<<<<<<< - * break - * - */ - __pyx_t_1 = (__pyx_cur_scope->__pyx_v_taos_row == NULL); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":367 - * taos_row = taos_fetch_row(self._res) - * if taos_row is NULL: - * break # <<<<<<<<<<<<<< - * - * row = [None] * self._field_count - */ - goto __pyx_L6_break; - - /* "taos/_objects.pyx":366 - * while True: - * taos_row = taos_fetch_row(self._res) - * if taos_row is NULL: # <<<<<<<<<<<<<< - * break - * - */ - } - - /* "taos/_objects.pyx":369 - * break - * - * row = [None] * self._field_count # <<<<<<<<<<<<<< - * for i in range(self._field_count): - * data = taos_row[i] - */ - __pyx_t_2 = PyList_New(1 * ((__pyx_cur_scope->__pyx_v_self->_field_count<0) ? 0:__pyx_cur_scope->__pyx_v_self->_field_count)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - { Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < __pyx_cur_scope->__pyx_v_self->_field_count; __pyx_temp++) { - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyList_SET_ITEM(__pyx_t_2, __pyx_temp, Py_None); - } - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, ((PyObject*)__pyx_t_2)); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "taos/_objects.pyx":370 - * - * row = [None] * self._field_count - * for i in range(self._field_count): # <<<<<<<<<<<<<< - * data = taos_row[i] - * field = self._fields[i] - */ - __pyx_t_5 = __pyx_cur_scope->__pyx_v_self->_field_count; - __pyx_t_6 = __pyx_t_5; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_cur_scope->__pyx_v_i = __pyx_t_7; - - /* "taos/_objects.pyx":371 - * row = [None] * self._field_count - * for i in range(self._field_count): - * data = taos_row[i] # <<<<<<<<<<<<<< - * field = self._fields[i] - * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): - */ - __pyx_cur_scope->__pyx_v_data = (__pyx_cur_scope->__pyx_v_taos_row[__pyx_cur_scope->__pyx_v_i]); - - /* "taos/_objects.pyx":372 - * for i in range(self._field_count): - * data = taos_row[i] - * field = self._fields[i] # <<<<<<<<<<<<<< - * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): - * row[i] = _parse_binary_string(data, 1, field.bytes)[0] - */ - __pyx_cur_scope->__pyx_v_field = (__pyx_cur_scope->__pyx_v_self->_fields[__pyx_cur_scope->__pyx_v_i]); - - /* "taos/_objects.pyx":373 - * data = taos_row[i] - * field = self._fields[i] - * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): # <<<<<<<<<<<<<< - * row[i] = _parse_binary_string(data, 1, field.bytes)[0] - * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): - */ - __pyx_t_8 = __pyx_cur_scope->__pyx_v_field.type; - __pyx_t_9 = (__pyx_t_8 == TSDB_DATA_TYPE_BINARY); - if (!__pyx_t_9) { - } else { - __pyx_t_1 = __pyx_t_9; - goto __pyx_L11_bool_binop_done; - } - __pyx_t_9 = (__pyx_t_8 == TSDB_DATA_TYPE_VARBINARY); - __pyx_t_1 = __pyx_t_9; - __pyx_L11_bool_binop_done:; - __pyx_t_9 = __pyx_t_1; - if (__pyx_t_9) { - - /* "taos/_objects.pyx":374 - * field = self._fields[i] - * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): - * row[i] = _parse_binary_string(data, 1, field.bytes)[0] # <<<<<<<<<<<<<< - * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): - * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] - */ - __pyx_t_2 = __pyx_f_4taos_7_parser__parse_binary_string(((size_t)__pyx_cur_scope->__pyx_v_data), 1, __pyx_cur_scope->__pyx_v_field.bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__pyx_t_2 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 374, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely((__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":373 - * data = taos_row[i] - * field = self._fields[i] - * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): # <<<<<<<<<<<<<< - * row[i] = _parse_binary_string(data, 1, field.bytes)[0] - * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): - */ - goto __pyx_L10; - } - - /* "taos/_objects.pyx":375 - * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): - * row[i] = _parse_binary_string(data, 1, field.bytes)[0] - * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): # <<<<<<<<<<<<<< - * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] - * elif field.type in SIZED_TYPE: - */ - __pyx_t_8 = __pyx_cur_scope->__pyx_v_field.type; - __pyx_t_1 = (__pyx_t_8 == TSDB_DATA_TYPE_NCHAR); - if (!__pyx_t_1) { - } else { - __pyx_t_9 = __pyx_t_1; - goto __pyx_L13_bool_binop_done; - } - __pyx_t_1 = (__pyx_t_8 == TSDB_DATA_TYPE_VARCHAR); - __pyx_t_9 = __pyx_t_1; - __pyx_L13_bool_binop_done:; - __pyx_t_1 = __pyx_t_9; - if (__pyx_t_1) { - - /* "taos/_objects.pyx":376 - * row[i] = _parse_binary_string(data, 1, field.bytes)[0] - * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): - * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] # <<<<<<<<<<<<<< - * elif field.type in SIZED_TYPE: - * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] - */ - __pyx_t_3 = __pyx_f_4taos_7_parser__parse_nchar_string(((size_t)__pyx_cur_scope->__pyx_v_data), 1, __pyx_cur_scope->__pyx_v_field.bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__pyx_t_3 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 376, __pyx_L1_error) - } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely((__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":375 - * if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): - * row[i] = _parse_binary_string(data, 1, field.bytes)[0] - * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): # <<<<<<<<<<<<<< - * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] - * elif field.type in SIZED_TYPE: - */ - goto __pyx_L10; - } - - /* "taos/_objects.pyx":377 - * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): - * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] - * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< - * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - */ - __pyx_t_2 = __Pyx_PyInt_From_int8_t(__pyx_cur_scope->__pyx_v_field.type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 377, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_1) { - - /* "taos/_objects.pyx":378 - * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] - * elif field.type in SIZED_TYPE: - * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] # <<<<<<<<<<<<<< - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CONVERT_FUNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_cur_scope->__pyx_v_field.type, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_cur_scope->__pyx_v_data)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = NULL; - __pyx_t_11 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_11 = 1; - } - } - { - PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_t_2, __pyx_int_1, __pyx_cur_scope->__pyx_v_is_null}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_11, 3+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely((__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, __pyx_t_4, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "taos/_objects.pyx":377 - * elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): - * row[i] = _parse_nchar_string(data, 1, field.bytes)[0] - * elif field.type in SIZED_TYPE: # <<<<<<<<<<<<<< - * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - */ - goto __pyx_L10; - } - - /* "taos/_objects.pyx":379 - * elif field.type in SIZED_TYPE: - * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< - * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] - * else: - */ - __pyx_t_8 = __pyx_cur_scope->__pyx_v_field.type; - __pyx_t_1 = (__pyx_t_8 == TSDB_DATA_TYPE_TIMESTAMP); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":380 - * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] # <<<<<<<<<<<<<< - * else: - * pass - */ - __pyx_t_4 = __pyx_f_4taos_7_parser__parse_timestamp(((size_t)__pyx_cur_scope->__pyx_v_data), 1, __pyx_cur_scope->__pyx_v_is_null, __pyx_cur_scope->__pyx_v_self->_precision, __pyx_cur_scope->__pyx_v_dt_epoch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__pyx_t_4 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 380, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely((__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0))) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":379 - * elif field.type in SIZED_TYPE: - * row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] - * elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): # <<<<<<<<<<<<<< - * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] - * else: - */ - goto __pyx_L10; - } - - /* "taos/_objects.pyx":382 - * row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] - * else: - * pass # <<<<<<<<<<<<<< - * - * self._row_count += 1 - */ - /*else*/ { - } - __pyx_L10:; - } - - /* "taos/_objects.pyx":384 - * pass - * - * self._row_count += 1 # <<<<<<<<<<<<<< - * yield row - * - */ - __pyx_cur_scope->__pyx_v_self->_row_count = (__pyx_cur_scope->__pyx_v_self->_row_count + 1); - - /* "taos/_objects.pyx":385 - * - * self._row_count += 1 - * yield row # <<<<<<<<<<<<<< - * - * def blocks_iter(self): - */ - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_row); - __pyx_r = __pyx_cur_scope->__pyx_v_row; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L15_resume_from_yield:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 385, __pyx_L1_error) - } - __pyx_L6_break:; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* "taos/_objects.pyx":355 - * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] - * - * def rows_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ - - /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("rows_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_4taos_8_objects_10TaosResult_23generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "taos/_objects.pyx":387 - * yield row - * - * def blocks_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_22blocks_iter(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_21blocks_iter, "TaosResult.blocks_iter(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_22blocks_iter = {"blocks_iter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_22blocks_iter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_21blocks_iter}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_22blocks_iter(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("blocks_iter (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("blocks_iter", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "blocks_iter", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_21blocks_iter(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_21blocks_iter(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("blocks_iter", 0); - __pyx_cur_scope = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter(__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 387, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_self = __pyx_v_self; - __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4taos_8_objects_10TaosResult_23generator1, __pyx_codeobj__28, (PyObject *) __pyx_cur_scope, __pyx_n_s_blocks_iter, __pyx_n_s_TaosResult_blocks_iter, __pyx_n_s_taos__objects); if (unlikely(!gen)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.blocks_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_4taos_8_objects_10TaosResult_23generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *__pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *(*__pyx_t_7)(PyObject *); - Py_ssize_t __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("blocks_iter", 0); - __Pyx_TraceFrameInit(__pyx_codeobj__28) - __Pyx_TraceCall("blocks_iter", __pyx_f[0], 387, 0, __PYX_ERR(0, 387, __pyx_L1_error)); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L13_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 387, __pyx_L1_error) - - /* "taos/_objects.pyx":388 - * - * def blocks_iter(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of rows_iter") - * - */ - __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->_res == NULL); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":389 - * def blocks_iter(self): - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") # <<<<<<<<<<<<<< - * - * while True: - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Invalid_use_of_rows_iter}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 389, __pyx_L1_error) - - /* "taos/_objects.pyx":388 - * - * def blocks_iter(self): - * if self._res is NULL: # <<<<<<<<<<<<<< - * raise OperationalError("Invalid use of rows_iter") - * - */ - } - - /* "taos/_objects.pyx":391 - * raise OperationalError("Invalid use of rows_iter") - * - * while True: # <<<<<<<<<<<<<< - * block, num_of_rows = self._fetch_block() - * - */ - while (1) { - - /* "taos/_objects.pyx":392 - * - * while True: - * block, num_of_rows = self._fetch_block() # <<<<<<<<<<<<<< - * - * if num_of_rows == 0: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_fetch_block); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 392, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_4 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 392, __pyx_L1_error) - __pyx_t_7 = NULL; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L8_unpacking_done; - __pyx_L7_unpacking_failed:; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 392, __pyx_L1_error) - __pyx_L8_unpacking_done:; - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_block); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_block, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_num_of_rows); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_num_of_rows, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "taos/_objects.pyx":394 - * block, num_of_rows = self._fetch_block() - * - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * break - * - */ - __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_cur_scope->__pyx_v_num_of_rows, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 394, __pyx_L1_error) - if (__pyx_t_1) { - - /* "taos/_objects.pyx":395 - * - * if num_of_rows == 0: - * break # <<<<<<<<<<<<<< - * - * yield [r for r in map(tuple, zip(*block))], num_of_rows - */ - goto __pyx_L6_break; - - /* "taos/_objects.pyx":394 - * block, num_of_rows = self._fetch_block() - * - * if num_of_rows == 0: # <<<<<<<<<<<<<< - * break - * - */ - } - - /* "taos/_objects.pyx":397 - * break - * - * yield [r for r in map(tuple, zip(*block))], num_of_rows # <<<<<<<<<<<<<< - * - * def fetch_rows_a(self, callback): - */ - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_block); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF((PyObject *)(&PyTuple_Type)); - __Pyx_GIVEREF((PyObject *)(&PyTuple_Type)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyTuple_Type))); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; - __pyx_t_9 = NULL; - } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 397, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_9)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 397, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 397, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_9(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 397, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_8genexpr6__pyx_v_r); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_8genexpr6__pyx_v_r, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_cur_scope->__pyx_8genexpr6__pyx_v_r))) __PYX_ERR(0, 397, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } /* exit inner scope */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_num_of_rows); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_num_of_rows); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_num_of_rows); - __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L13_resume_from_yield:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 397, __pyx_L1_error) - } - __pyx_L6_break:; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* "taos/_objects.pyx":387 - * yield row - * - * def blocks_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ - - /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("blocks_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":399 - * yield [r for r in map(tuple, zip(*block))], num_of_rows - * - * def fetch_rows_a(self, callback): # <<<<<<<<<<<<<< - * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_25fetch_rows_a(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_24fetch_rows_a, "TaosResult.fetch_rows_a(self, callback)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_25fetch_rows_a = {"fetch_rows_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_25fetch_rows_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_24fetch_rows_a}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_25fetch_rows_a(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_callback = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fetch_rows_a (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback_2,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback_2)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetch_rows_a") < 0)) __PYX_ERR(0, 399, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_callback = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fetch_rows_a", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 399, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.fetch_rows_a", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_24fetch_rows_a(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self), __pyx_v_callback); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_24fetch_rows_a(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, PyObject *__pyx_v_callback) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__29) - __Pyx_RefNannySetupContext("fetch_rows_a", 0); - __Pyx_TraceCall("fetch_rows_a", __pyx_f[0], 399, 0, __PYX_ERR(0, 399, __pyx_L1_error)); - - /* "taos/_objects.pyx":400 - * - * def fetch_rows_a(self, callback): - * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) # <<<<<<<<<<<<<< - * - * def taos_fetch_raw_block_a(self, callback): - */ - taos_fetch_rows_a(__pyx_v_self->_res, __pyx_f_4taos_8_objects_async_callback_wrapper, ((void *)__pyx_v_callback)); - - /* "taos/_objects.pyx":399 - * yield [r for r in map(tuple, zip(*block))], num_of_rows - * - * def fetch_rows_a(self, callback): # <<<<<<<<<<<<<< - * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.fetch_rows_a", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":402 - * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) - * - * def taos_fetch_raw_block_a(self, callback): # <<<<<<<<<<<<<< - * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a, "TaosResult.taos_fetch_raw_block_a(self, callback)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a = {"taos_fetch_raw_block_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_callback = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("taos_fetch_raw_block_a (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback_2,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_callback_2)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "taos_fetch_raw_block_a") < 0)) __PYX_ERR(0, 402, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_callback = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("taos_fetch_raw_block_a", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 402, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.taos_fetch_raw_block_a", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self), __pyx_v_callback); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, PyObject *__pyx_v_callback) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__30) - __Pyx_RefNannySetupContext("taos_fetch_raw_block_a", 0); - __Pyx_TraceCall("taos_fetch_raw_block_a", __pyx_f[0], 402, 0, __PYX_ERR(0, 402, __pyx_L1_error)); - - /* "taos/_objects.pyx":403 - * - * def taos_fetch_raw_block_a(self, callback): - * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - taos_fetch_raw_block_a(__pyx_v_self->_res, __pyx_f_4taos_8_objects_async_callback_wrapper, ((void *)__pyx_v_callback)); - - /* "taos/_objects.pyx":402 - * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) - * - * def taos_fetch_raw_block_a(self, callback): # <<<<<<<<<<<<<< - * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) - * - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.taos_fetch_raw_block_a", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":405 - * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._res is not NULL: - * taos_free_result(self._res) - */ - -/* Python wrapper */ -static void __pyx_pw_4taos_8_objects_10TaosResult_29__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_4taos_8_objects_10TaosResult_29__dealloc__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_4taos_8_objects_10TaosResult_28__dealloc__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_4taos_8_objects_10TaosResult_28__dealloc__(struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__dealloc__", 0); - __Pyx_TraceCall("__dealloc__", __pyx_f[0], 405, 0, __PYX_ERR(0, 405, __pyx_L1_error)); - - /* "taos/_objects.pyx":406 - * - * def __dealloc__(self): - * if self._res is not NULL: # <<<<<<<<<<<<<< - * taos_free_result(self._res) - * - */ - __pyx_t_1 = (__pyx_v_self->_res != NULL); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":407 - * def __dealloc__(self): - * if self._res is not NULL: - * taos_free_result(self._res) # <<<<<<<<<<<<<< - * - * self._res = NULL - */ - taos_free_result(__pyx_v_self->_res); - - /* "taos/_objects.pyx":406 - * - * def __dealloc__(self): - * if self._res is not NULL: # <<<<<<<<<<<<<< - * taos_free_result(self._res) - * - */ - } - - /* "taos/_objects.pyx":409 - * taos_free_result(self._res) - * - * self._res = NULL # <<<<<<<<<<<<<< - * self._fields = NULL - * - */ - __pyx_v_self->_res = NULL; - - /* "taos/_objects.pyx":410 - * - * self._res = NULL - * self._fields = NULL # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_self->_fields = NULL; - - /* "taos/_objects.pyx":405 - * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._res is not NULL: - * taos_free_result(self._res) - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_WriteUnraisable("taos._objects.TaosResult.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); -} - -/* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_31__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_30__reduce_cython__, "TaosResult.__reduce_cython__(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_31__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_30__reduce_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_31__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_30__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__31) - __Pyx_RefNannySetupContext("__reduce_cython__", 0); - __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); - - /* "(tree fragment)":2 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 2, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_33__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosResult_32__setstate_cython__, "TaosResult.__setstate_cython__(self, __pyx_state)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosResult_33__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_32__setstate_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosResult_33__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v___pyx_state = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosResult_32__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_v_self), __pyx_v___pyx_state); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosResult_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__32) - __Pyx_RefNannySetupContext("__setstate_cython__", 0); - __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); - - /* "(tree fragment)":4 - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 4, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosResult.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":418 - * cdef TaosResult _result - * - * def __init__(self, connection: TaosConnection=None) -> None: # <<<<<<<<<<<<<< - * self._description = [] - * self._connection = connection - */ - -/* Python wrapper */ -static int __pyx_pw_4taos_8_objects_10TaosCursor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_4taos_8_objects_10TaosCursor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_connection = 0; - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_connection,0}; - PyObject* values[1] = {0}; - values[0] = (PyObject *)((struct __pyx_obj_4taos_8_objects_TaosConnection *)Py_None); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_connection); - if (value) { values[0] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 418, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 418, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosCursor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_connection), __pyx_ptype_4taos_8_objects_TaosConnection, 1, "connection", 0))) __PYX_ERR(0, 418, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor___init__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self), __pyx_v_connection); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4taos_8_objects_10TaosCursor___init__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosConnection *__pyx_v_connection) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - __Pyx_TraceCall("__init__", __pyx_f[0], 418, 0, __PYX_ERR(0, 418, __pyx_L1_error)); - - /* "taos/_objects.pyx":419 - * - * def __init__(self, connection: TaosConnection=None) -> None: - * self._description = [] # <<<<<<<<<<<<<< - * self._connection = connection - * self._result = None - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->_description); - __Pyx_DECREF(__pyx_v_self->_description); - __pyx_v_self->_description = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":420 - * def __init__(self, connection: TaosConnection=None) -> None: - * self._description = [] - * self._connection = connection # <<<<<<<<<<<<<< - * self._result = None - * - */ - __Pyx_INCREF((PyObject *)__pyx_v_connection); - __Pyx_GIVEREF((PyObject *)__pyx_v_connection); - __Pyx_GOTREF((PyObject *)__pyx_v_self->_connection); - __Pyx_DECREF((PyObject *)__pyx_v_self->_connection); - __pyx_v_self->_connection = __pyx_v_connection; - - /* "taos/_objects.pyx":421 - * self._description = [] - * self._connection = connection - * self._result = None # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF((PyObject *)__pyx_v_self->_result); - __Pyx_DECREF((PyObject *)__pyx_v_self->_result); - __pyx_v_self->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)Py_None); - - /* "taos/_objects.pyx":418 - * cdef TaosResult _result - * - * def __init__(self, connection: TaosConnection=None) -> None: # <<<<<<<<<<<<<< - * self._description = [] - * self._connection = connection - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosCursor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_4taos_8_objects_10TaosCursor_4generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "taos/_objects.pyx":423 - * self._result = None - * - * def __iter__(self): # <<<<<<<<<<<<<< - * for block, num_of_rows in self._result.blocks_iter(): - * for row in block: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_3__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_3__iter__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_2__iter__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_2__iter__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__iter__", 0); - __pyx_cur_scope = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__(__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 423, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_self = __pyx_v_self; - __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4taos_8_objects_10TaosCursor_4generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TaosCursor___iter, __pyx_n_s_taos__objects); if (unlikely(!gen)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosCursor.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_4taos_8_objects_10TaosCursor_4generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *(*__pyx_t_9)(PyObject *); - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__", 0); - __Pyx_TraceCall("__iter__", __pyx_f[0], 423, 0, __PYX_ERR(0, 423, __pyx_L1_error)); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L10_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 423, __pyx_L1_error) - - /* "taos/_objects.pyx":424 - * - * def __iter__(self): - * for block, num_of_rows in self._result.blocks_iter(): # <<<<<<<<<<<<<< - * for row in block: - * yield row - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_result), __pyx_n_s_blocks_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_6)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 424, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 424, __pyx_L1_error) - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_6(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 424, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 424, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 424, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); - index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 424, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L7_unpacking_done; - __pyx_L6_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 424, __pyx_L1_error) - __pyx_L7_unpacking_done:; - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_block); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_block, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_num_of_rows); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_num_of_rows, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - - /* "taos/_objects.pyx":425 - * def __iter__(self): - * for block, num_of_rows in self._result.blocks_iter(): - * for row in block: # <<<<<<<<<<<<<< - * yield row - * - */ - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_block)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_block)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_v_block; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; - __pyx_t_11 = NULL; - } else { - __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_block); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 425, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 425, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - } else { - if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 425, __pyx_L1_error) - #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - #endif - } - } else { - __pyx_t_7 = __pyx_t_11(__pyx_t_1); - if (unlikely(!__pyx_t_7)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 425, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_7); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - - /* "taos/_objects.pyx":426 - * for block, num_of_rows in self._result.blocks_iter(): - * for row in block: - * yield row # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_row); - __pyx_r = __pyx_cur_scope->__pyx_v_row; - __Pyx_XGIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; - __Pyx_XGIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; - __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; - __pyx_cur_scope->__pyx_t_3 = __pyx_t_6; - __pyx_cur_scope->__pyx_t_4 = __pyx_t_10; - __pyx_cur_scope->__pyx_t_5 = __pyx_t_11; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L10_resume_from_yield:; - __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - __pyx_cur_scope->__pyx_t_1 = 0; - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; - __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - __pyx_t_10 = __pyx_cur_scope->__pyx_t_4; - __pyx_t_11 = __pyx_cur_scope->__pyx_t_5; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 426, __pyx_L1_error) - - /* "taos/_objects.pyx":425 - * def __iter__(self): - * for block, num_of_rows in self._result.blocks_iter(): - * for row in block: # <<<<<<<<<<<<<< - * yield row - * - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_objects.pyx":424 - * - * def __iter__(self): - * for block, num_of_rows in self._result.blocks_iter(): # <<<<<<<<<<<<<< - * for row in block: - * yield row - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* "taos/_objects.pyx":423 - * self._result = None - * - * def __iter__(self): # <<<<<<<<<<<<<< - * for block, num_of_rows in self._result.blocks_iter(): - * for row in block: - */ - - /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":428 - * yield row - * - * @property # <<<<<<<<<<<<<< - * def description(self): - * return self._description - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_11description_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_11description_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_11description___get__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_11description___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 428, 0, __PYX_ERR(0, 428, __pyx_L1_error)); - - /* "taos/_objects.pyx":430 - * @property - * def description(self): - * return self._description # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->_description); - __pyx_r = __pyx_v_self->_description; - goto __pyx_L0; - - /* "taos/_objects.pyx":428 - * yield row - * - * @property # <<<<<<<<<<<<<< - * def description(self): - * return self._description - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosCursor.description.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":432 - * return self._description - * - * @property # <<<<<<<<<<<<<< - * def rowcount(self): - * return self._result.row_count - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_8rowcount_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_8rowcount_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_8rowcount___get__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_8rowcount___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 432, 0, __PYX_ERR(0, 432, __pyx_L1_error)); - - /* "taos/_objects.pyx":434 - * @property - * def rowcount(self): - * return self._result.row_count # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_result), __pyx_n_s_row_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":432 - * return self._description - * - * @property # <<<<<<<<<<<<<< - * def rowcount(self): - * return self._result.row_count - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosCursor.rowcount.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":436 - * return self._result.row_count - * - * @property # <<<<<<<<<<<<<< - * def affected_rows(self): - * """Return the rowcount of insertion""" - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_13affected_rows_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_13affected_rows_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_13affected_rows___get__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_13affected_rows___get__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 436, 0, __PYX_ERR(0, 436, __pyx_L1_error)); - - /* "taos/_objects.pyx":439 - * def affected_rows(self): - * """Return the rowcount of insertion""" - * return self._result.affected_rows # <<<<<<<<<<<<<< - * - * def execute(self, sql, params=None, req_id: Optional[int] = None): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_result), __pyx_n_s_affected_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":436 - * return self._result.row_count - * - * @property # <<<<<<<<<<<<<< - * def affected_rows(self): - * """Return the rowcount of insertion""" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosCursor.affected_rows.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":441 - * return self._result.affected_rows - * - * def execute(self, sql, params=None, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * """Prepare and execute a database operation (query or command).""" - * if not self._connection: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_6execute(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_5execute, "TaosCursor.execute(self, sql, params=None, int req_id: Optional[int] = None)\nPrepare and execute a database operation (query or command)."); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_6execute = {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_6execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_5execute}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_6execute(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_sql = 0; - CYTHON_UNUSED PyObject *__pyx_v_params = 0; - PyObject *__pyx_v_req_id = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("execute (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sql,&__pyx_n_s_params,&__pyx_n_s_req_id,0}; - PyObject* values[3] = {0,0,0}; - values[1] = ((PyObject *)Py_None); - values[2] = ((PyObject*)Py_None); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sql)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params); - if (value) { values[1] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_req_id); - if (value) { values[2] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "execute") < 0)) __PYX_ERR(0, 441, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_sql = values[0]; - __pyx_v_params = values[1]; - __pyx_v_req_id = ((PyObject*)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("execute", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 441, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosCursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_req_id), (&PyInt_Type), 1, "req_id", 1))) __PYX_ERR(0, 441, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_5execute(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self), __pyx_v_sql, __pyx_v_params, __pyx_v_req_id); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_5execute(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, PyObject *__pyx_v_sql, CYTHON_UNUSED PyObject *__pyx_v_params, PyObject *__pyx_v_req_id) { - PyObject *__pyx_8genexpr7__pyx_v_f = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__33) - __Pyx_RefNannySetupContext("execute", 0); - __Pyx_TraceCall("execute", __pyx_f[0], 441, 0, __PYX_ERR(0, 441, __pyx_L1_error)); - - /* "taos/_objects.pyx":443 - * def execute(self, sql, params=None, req_id: Optional[int] = None): - * """Prepare and execute a database operation (query or command).""" - * if not self._connection: # <<<<<<<<<<<<<< - * raise ProgrammingError("Cursor is not connected") - * - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->_connection)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 443, __pyx_L1_error) - __pyx_t_2 = (!__pyx_t_1); - if (unlikely(__pyx_t_2)) { - - /* "taos/_objects.pyx":444 - * """Prepare and execute a database operation (query or command).""" - * if not self._connection: - * raise ProgrammingError("Cursor is not connected") # <<<<<<<<<<<<<< - * - * self._reset_result() - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_Cursor_is_not_connected}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 444, __pyx_L1_error) - - /* "taos/_objects.pyx":443 - * def execute(self, sql, params=None, req_id: Optional[int] = None): - * """Prepare and execute a database operation (query or command).""" - * if not self._connection: # <<<<<<<<<<<<<< - * raise ProgrammingError("Cursor is not connected") - * - */ - } - - /* "taos/_objects.pyx":446 - * raise ProgrammingError("Cursor is not connected") - * - * self._reset_result() # <<<<<<<<<<<<<< - * - * self._result = self._connection.query(sql, req_id) - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_5, }; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":448 - * self._reset_result() - * - * self._result = self._connection.query(sql, req_id) # <<<<<<<<<<<<<< - * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] - * - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_connection), __pyx_n_s_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_sql, __pyx_v_req_id}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4taos_8_objects_TaosResult))))) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GOTREF((PyObject *)__pyx_v_self->_result); - __Pyx_DECREF((PyObject *)__pyx_v_self->_result); - __pyx_v_self->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "taos/_objects.pyx":449 - * - * self._result = self._connection.query(sql, req_id) - * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] # <<<<<<<<<<<<<< - * - * def fetchone(self): - */ - { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_result), __pyx_n_s_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_4); - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 449, __pyx_L6_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 449, __pyx_L6_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 449, __pyx_L6_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_8(__pyx_t_5); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 449, __pyx_L6_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_f, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_f, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - __pyx_t_6 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_6 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_utf_8}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_f, __pyx_n_s_type_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 3, Py_None); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 4, Py_None); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 5, Py_None); - __Pyx_INCREF(Py_False); - __Pyx_GIVEREF(Py_False); - PyTuple_SET_ITEM(__pyx_t_9, 6, Py_False); - __pyx_t_4 = 0; - __pyx_t_10 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 449, __pyx_L6_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_f); __pyx_8genexpr7__pyx_v_f = 0; - goto __pyx_L10_exit_scope; - __pyx_L6_error:; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_f); __pyx_8genexpr7__pyx_v_f = 0; - goto __pyx_L1_error; - __pyx_L10_exit_scope:; - } /* exit inner scope */ - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_v_self->_description); - __Pyx_DECREF(__pyx_v_self->_description); - __pyx_v_self->_description = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "taos/_objects.pyx":441 - * return self._result.affected_rows - * - * def execute(self, sql, params=None, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * """Prepare and execute a database operation (query or command).""" - * if not self._connection: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("taos._objects.TaosCursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_f); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":451 - * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] - * - * def fetchone(self): # <<<<<<<<<<<<<< - * return next(self) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_8fetchone(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_7fetchone, "TaosCursor.fetchone(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_8fetchone = {"fetchone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_8fetchone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_7fetchone}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_8fetchone(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fetchone (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("fetchone", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetchone", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_7fetchone(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_7fetchone(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__34) - __Pyx_RefNannySetupContext("fetchone", 0); - __Pyx_TraceCall("fetchone", __pyx_f[0], 451, 0, __PYX_ERR(0, 451, __pyx_L1_error)); - - /* "taos/_objects.pyx":452 - * - * def fetchone(self): - * return next(self) # <<<<<<<<<<<<<< - * - * def fetchall(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":451 - * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] - * - * def fetchone(self): # <<<<<<<<<<<<<< - * return next(self) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosCursor.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":454 - * return next(self) - * - * def fetchall(self): # <<<<<<<<<<<<<< - * return [r for r in self] - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_10fetchall(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_9fetchall, "TaosCursor.fetchall(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_10fetchall = {"fetchall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_10fetchall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_9fetchall}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_10fetchall(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fetchall (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("fetchall", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "fetchall", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_9fetchall(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_9fetchall(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - PyObject *__pyx_8genexpr8__pyx_v_r = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__35) - __Pyx_RefNannySetupContext("fetchall", 0); - __Pyx_TraceCall("fetchall", __pyx_f[0], 454, 0, __PYX_ERR(0, 454, __pyx_L1_error)); - - /* "taos/_objects.pyx":455 - * - * def fetchall(self): - * return [r for r in self] # <<<<<<<<<<<<<< - * - * def close(self): - */ - __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) { - __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L5_error) - } - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 455, __pyx_L5_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 455, __pyx_L5_error) - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - } - } else { - __pyx_t_5 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_5)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 455, __pyx_L5_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_5); - } - __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_r, __pyx_t_5); - __pyx_t_5 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr8__pyx_v_r))) __PYX_ERR(0, 455, __pyx_L5_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); __pyx_8genexpr8__pyx_v_r = 0; - goto __pyx_L9_exit_scope; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); __pyx_8genexpr8__pyx_v_r = 0; - goto __pyx_L1_error; - __pyx_L9_exit_scope:; - } /* exit inner scope */ - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":454 - * return next(self) - * - * def fetchall(self): # <<<<<<<<<<<<<< - * return [r for r in self] - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("taos._objects.TaosCursor.fetchall", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_r); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":457 - * return [r for r in self] - * - * def close(self): # <<<<<<<<<<<<<< - * if self._connection is None: - * return False - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_12close(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_11close, "TaosCursor.close(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_12close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_12close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_11close}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_12close(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("close (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_11close(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_11close(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__36) - __Pyx_RefNannySetupContext("close", 0); - __Pyx_TraceCall("close", __pyx_f[0], 457, 0, __PYX_ERR(0, 457, __pyx_L1_error)); - - /* "taos/_objects.pyx":458 - * - * def close(self): - * if self._connection is None: # <<<<<<<<<<<<<< - * return False - * - */ - __pyx_t_1 = (((PyObject *)__pyx_v_self->_connection) == Py_None); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":459 - * def close(self): - * if self._connection is None: - * return False # <<<<<<<<<<<<<< - * - * self._reset_result() - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "taos/_objects.pyx":458 - * - * def close(self): - * if self._connection is None: # <<<<<<<<<<<<<< - * return False - * - */ - } - - /* "taos/_objects.pyx":461 - * return False - * - * self._reset_result() # <<<<<<<<<<<<<< - * self._connection = None - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":462 - * - * self._reset_result() - * self._connection = None # <<<<<<<<<<<<<< - * - * return True - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF((PyObject *)__pyx_v_self->_connection); - __Pyx_DECREF((PyObject *)__pyx_v_self->_connection); - __pyx_v_self->_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)Py_None); - - /* "taos/_objects.pyx":464 - * self._connection = None - * - * return True # <<<<<<<<<<<<<< - * - * def _reset_result(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "taos/_objects.pyx":457 - * return [r for r in self] - * - * def close(self): # <<<<<<<<<<<<<< - * if self._connection is None: - * return False - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("taos._objects.TaosCursor.close", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":466 - * return True - * - * def _reset_result(self): # <<<<<<<<<<<<<< - * """Reset the result to unused version.""" - * self._description = [] - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_14_reset_result(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_13_reset_result, "TaosCursor._reset_result(self)\nReset the result to unused version."); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_14_reset_result = {"_reset_result", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_14_reset_result, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_13_reset_result}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_14_reset_result(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_reset_result (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("_reset_result", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_reset_result", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_13_reset_result(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_13_reset_result(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__37) - __Pyx_RefNannySetupContext("_reset_result", 0); - __Pyx_TraceCall("_reset_result", __pyx_f[0], 466, 0, __PYX_ERR(0, 466, __pyx_L1_error)); - - /* "taos/_objects.pyx":468 - * def _reset_result(self): - * """Reset the result to unused version.""" - * self._description = [] # <<<<<<<<<<<<<< - * self._result = None - * - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_self->_description); - __Pyx_DECREF(__pyx_v_self->_description); - __pyx_v_self->_description = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":469 - * """Reset the result to unused version.""" - * self._description = [] - * self._result = None # <<<<<<<<<<<<<< - * - * def __del__(self): - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF((PyObject *)__pyx_v_self->_result); - __Pyx_DECREF((PyObject *)__pyx_v_self->_result); - __pyx_v_self->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)Py_None); - - /* "taos/_objects.pyx":466 - * return True - * - * def _reset_result(self): # <<<<<<<<<<<<<< - * """Reset the result to unused version.""" - * self._description = [] - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosCursor._reset_result", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":471 - * self._result = None - * - * def __del__(self): # <<<<<<<<<<<<<< - * self.close() - * - */ - -/* Python wrapper */ -static void __pyx_pw_4taos_8_objects_10TaosCursor_16__del__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_4taos_8_objects_10TaosCursor_16__del__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_pf_4taos_8_objects_10TaosCursor_15__del__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_4taos_8_objects_10TaosCursor_15__del__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_TraceCall("__del__", __pyx_f[0], 471, 0, __PYX_ERR(0, 471, __pyx_L1_error)); - - /* "taos/_objects.pyx":472 - * - * def __del__(self): - * self.close() # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_objects.pyx":471 - * self._result = None - * - * def __del__(self): # <<<<<<<<<<<<<< - * self.close() - * - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("taos._objects.TaosCursor.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); -} - -/* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_18__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_17__reduce_cython__, "TaosCursor.__reduce_cython__(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_18__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_18__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_17__reduce_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_18__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_17__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_17__reduce_cython__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self) { - PyObject *__pyx_v_state = 0; - PyObject *__pyx_v__dict = 0; - int __pyx_v_use_setstate; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__38) - __Pyx_RefNannySetupContext("__reduce_cython__", 0); - __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); - - /* "(tree fragment)":5 - * cdef object _dict - * cdef bint use_setstate - * state = (self._connection, self._description, self._result) # <<<<<<<<<<<<<< - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF((PyObject *)__pyx_v_self->_connection); - __Pyx_GIVEREF((PyObject *)__pyx_v_self->_connection); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->_connection)); - __Pyx_INCREF(__pyx_v_self->_description); - __Pyx_GIVEREF(__pyx_v_self->_description); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_description); - __Pyx_INCREF((PyObject *)__pyx_v_self->_result); - __Pyx_GIVEREF((PyObject *)__pyx_v_self->_result); - PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->_result)); - __pyx_v_state = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "(tree fragment)":6 - * cdef bint use_setstate - * state = (self._connection, self._description, self._result) - * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< - * if _dict is not None: - * state += (_dict,) - */ - __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__dict = __pyx_t_1; - __pyx_t_1 = 0; - - /* "(tree fragment)":7 - * state = (self._connection, self._description, self._result) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - __pyx_t_2 = (__pyx_v__dict != Py_None); - if (__pyx_t_2) { - - /* "(tree fragment)":8 - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - * state += (_dict,) # <<<<<<<<<<<<<< - * use_setstate = True - * else: - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v__dict); - __Pyx_GIVEREF(__pyx_v__dict); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "(tree fragment)":9 - * if _dict is not None: - * state += (_dict,) - * use_setstate = True # <<<<<<<<<<<<<< - * else: - * use_setstate = self._connection is not None or self._description is not None or self._result is not None - */ - __pyx_v_use_setstate = 1; - - /* "(tree fragment)":7 - * state = (self._connection, self._description, self._result) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - goto __pyx_L3; - } - - /* "(tree fragment)":11 - * use_setstate = True - * else: - * use_setstate = self._connection is not None or self._description is not None or self._result is not None # <<<<<<<<<<<<<< - * if use_setstate: - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state - */ - /*else*/ { - __pyx_t_4 = (((PyObject *)__pyx_v_self->_connection) != Py_None); - if (!__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = (__pyx_v_self->_description != ((PyObject*)Py_None)); - if (!__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = (((PyObject *)__pyx_v_self->_result) != Py_None); - __pyx_t_2 = __pyx_t_4; - __pyx_L4_bool_binop_done:; - __pyx_v_use_setstate = __pyx_t_2; - } - __pyx_L3:; - - /* "(tree fragment)":12 - * else: - * use_setstate = self._connection is not None or self._description is not None or self._result is not None - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state - * else: - */ - if (__pyx_v_use_setstate) { - - /* "(tree fragment)":13 - * use_setstate = self._connection is not None or self._description is not None or self._result is not None - * if use_setstate: - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state # <<<<<<<<<<<<<< - * else: - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_TaosCursor); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_126557407); - __Pyx_GIVEREF(__pyx_int_126557407); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_126557407); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_3 = 0; - __pyx_t_1 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "(tree fragment)":12 - * else: - * use_setstate = self._connection is not None or self._description is not None or self._result is not None - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state - * else: - */ - } - - /* "(tree fragment)":15 - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, None), state - * else: - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_TaosCursor); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_126557407); - __Pyx_GIVEREF(__pyx_int_126557407); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_126557407); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - __pyx_t_5 = 0; - __pyx_t_1 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - } - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("taos._objects.TaosCursor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v__dict); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":16 - * else: - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_20__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_10TaosCursor_19__setstate_cython__, "TaosCursor.__setstate_cython__(self, __pyx_state)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_10TaosCursor_20__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_20__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_19__setstate_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_10TaosCursor_20__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v___pyx_state = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v___pyx_state = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosCursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_10TaosCursor_19__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v_self), __pyx_v___pyx_state); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_10TaosCursor_19__setstate_cython__(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__39) - __Pyx_RefNannySetupContext("__setstate_cython__", 0); - __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); - - /* "(tree fragment)":17 - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) - * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) # <<<<<<<<<<<<<< - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_4taos_8_objects___pyx_unpickle_TaosCursor__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosCursor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":481 - * cdef int64_t _end - * - * def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): # <<<<<<<<<<<<<< - * self._vg_id = vg_id - * self._current_offset = current_offset - */ - -/* Python wrapper */ -static int __pyx_pw_4taos_8_objects_19TaosTopicAssignment_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_4taos_8_objects_19TaosTopicAssignment_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int32_t __pyx_v_vg_id; - int64_t __pyx_v_current_offset; - int64_t __pyx_v_begin; - int64_t __pyx_v_end; - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vg_id,&__pyx_n_s_current_offset,&__pyx_n_s_begin,&__pyx_n_s_end,0}; - PyObject* values[4] = {0,0,0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_current_offset)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); __PYX_ERR(0, 481, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_begin)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); __PYX_ERR(0, 481, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); __PYX_ERR(0, 481, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 481, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 4)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); - values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); - values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); - } - __pyx_v_vg_id = __Pyx_PyInt_As_int32_t(values[0]); if (unlikely((__pyx_v_vg_id == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) - __pyx_v_current_offset = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_current_offset == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) - __pyx_v_begin = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_begin == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) - __pyx_v_end = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_end == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment___cinit__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self), __pyx_v_vg_id, __pyx_v_current_offset, __pyx_v_begin, __pyx_v_end); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4taos_8_objects_19TaosTopicAssignment___cinit__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self, int32_t __pyx_v_vg_id, int64_t __pyx_v_current_offset, int64_t __pyx_v_begin, int64_t __pyx_v_end) { - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); - __Pyx_TraceCall("__cinit__", __pyx_f[0], 481, 0, __PYX_ERR(0, 481, __pyx_L1_error)); - - /* "taos/_objects.pyx":482 - * - * def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): - * self._vg_id = vg_id # <<<<<<<<<<<<<< - * self._current_offset = current_offset - * self._begin = begin - */ - __pyx_v_self->_vg_id = __pyx_v_vg_id; - - /* "taos/_objects.pyx":483 - * def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): - * self._vg_id = vg_id - * self._current_offset = current_offset # <<<<<<<<<<<<<< - * self._begin = begin - * self._end = end - */ - __pyx_v_self->_current_offset = __pyx_v_current_offset; - - /* "taos/_objects.pyx":484 - * self._vg_id = vg_id - * self._current_offset = current_offset - * self._begin = begin # <<<<<<<<<<<<<< - * self._end = end - * - */ - __pyx_v_self->_begin = __pyx_v_begin; - - /* "taos/_objects.pyx":485 - * self._current_offset = current_offset - * self._begin = begin - * self._end = end # <<<<<<<<<<<<<< - * - * @property - */ - __pyx_v_self->_end = __pyx_v_end; - - /* "taos/_objects.pyx":481 - * cdef int64_t _end - * - * def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): # <<<<<<<<<<<<<< - * self._vg_id = vg_id - * self._current_offset = current_offset - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":487 - * self._end = end - * - * @property # <<<<<<<<<<<<<< - * def vg_id(self): - * return self._vg_id - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5vg_id_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5vg_id_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_5vg_id___get__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_5vg_id___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 487, 0, __PYX_ERR(0, 487, __pyx_L1_error)); - - /* "taos/_objects.pyx":489 - * @property - * def vg_id(self): - * return self._vg_id # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_vg_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":487 - * self._end = end - * - * @property # <<<<<<<<<<<<<< - * def vg_id(self): - * return self._vg_id - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.vg_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":491 - * return self._vg_id - * - * @property # <<<<<<<<<<<<<< - * def current_offset(self): - * return self._current_offset - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_14current_offset_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_14current_offset_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_14current_offset___get__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_14current_offset___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 491, 0, __PYX_ERR(0, 491, __pyx_L1_error)); - - /* "taos/_objects.pyx":493 - * @property - * def current_offset(self): - * return self._current_offset # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_current_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":491 - * return self._vg_id - * - * @property # <<<<<<<<<<<<<< - * def current_offset(self): - * return self._current_offset - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.current_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":495 - * return self._current_offset - * - * @property # <<<<<<<<<<<<<< - * def begin(self): - * return self._begin - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5begin_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5begin_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_5begin___get__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_5begin___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 495, 0, __PYX_ERR(0, 495, __pyx_L1_error)); - - /* "taos/_objects.pyx":497 - * @property - * def begin(self): - * return self._begin # <<<<<<<<<<<<<< - * - * @property - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":495 - * return self._current_offset - * - * @property # <<<<<<<<<<<<<< - * def begin(self): - * return self._begin - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.begin.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":499 - * return self._begin - * - * @property # <<<<<<<<<<<<<< - * def end(self): - * return self._end - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3end_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3end_1__get__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_3end___get__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_3end___get__(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_TraceCall("__get__", __pyx_f[0], 499, 0, __PYX_ERR(0, 499, __pyx_L1_error)); - - /* "taos/_objects.pyx":501 - * @property - * def end(self): - * return self._end # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":499 - * return self._begin - * - * @property # <<<<<<<<<<<<<< - * def end(self): - * return self._end - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__, "TaosTopicAssignment.__reduce_cython__(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__40) - __Pyx_RefNannySetupContext("__reduce_cython__", 0); - __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); - - /* "(tree fragment)":2 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 2, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__, "TaosTopicAssignment.__setstate_cython__(self, __pyx_state)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v___pyx_state = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_v_self), __pyx_v___pyx_state); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__41) - __Pyx_RefNannySetupContext("__setstate_cython__", 0); - __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); - - /* "(tree fragment)":4 - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 4, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosTopicAssignment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":509 - * cdef tmq_t *_tmq - * - * def __cinit__(self, configs: dict[str, str]): # <<<<<<<<<<<<<< - * self._configs = configs - * self._tmq_conf = tmq_conf_new() - */ - -/* Python wrapper */ -static int __pyx_pw_4taos_8_objects_12TaosConsumer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_4taos_8_objects_12TaosConsumer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_configs = 0; - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_configs,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_configs)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 509, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - } - __pyx_v_configs = ((PyObject*)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 509, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_configs), (&PyDict_Type), 0, "configs", 1))) __PYX_ERR(0, 509, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer___cinit__(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_configs); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_4taos_8_objects_12TaosConsumer___cinit__(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_configs) { - PyObject *__pyx_v_k = NULL; - PyObject *__pyx_v_v = NULL; - PyObject *__pyx_v__k = NULL; - PyObject *__pyx_v__v = NULL; - tmq_conf_res_t __pyx_v_tmq_conf_res; - int __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - char const *__pyx_t_9; - char const *__pyx_t_10; - int __pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); - __Pyx_TraceCall("__cinit__", __pyx_f[0], 509, 0, __PYX_ERR(0, 509, __pyx_L1_error)); - - /* "taos/_objects.pyx":510 - * - * def __cinit__(self, configs: dict[str, str]): - * self._configs = configs # <<<<<<<<<<<<<< - * self._tmq_conf = tmq_conf_new() - * for k, v in self._configs.items(): - */ - __Pyx_INCREF(__pyx_v_configs); - __Pyx_GIVEREF(__pyx_v_configs); - __Pyx_GOTREF(__pyx_v_self->_configs); - __Pyx_DECREF(__pyx_v_self->_configs); - __pyx_v_self->_configs = __pyx_v_configs; - - /* "taos/_objects.pyx":511 - * def __cinit__(self, configs: dict[str, str]): - * self._configs = configs - * self._tmq_conf = tmq_conf_new() # <<<<<<<<<<<<<< - * for k, v in self._configs.items(): - * _k = k.encode("utf-8") - */ - __pyx_v_self->_tmq_conf = tmq_conf_new(); - - /* "taos/_objects.pyx":512 - * self._configs = configs - * self._tmq_conf = tmq_conf_new() - * for k, v in self._configs.items(): # <<<<<<<<<<<<<< - * _k = k.encode("utf-8") - * _v = v.encode("utf-8") - */ - __pyx_t_2 = 0; - if (unlikely(__pyx_v_self->_configs == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 512, __pyx_L1_error) - } - __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->_configs, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); - __pyx_t_1 = __pyx_t_5; - __pyx_t_5 = 0; - while (1) { - __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); - if (unlikely(__pyx_t_7 == 0)) break; - if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); - __pyx_t_6 = 0; - - /* "taos/_objects.pyx":513 - * self._tmq_conf = tmq_conf_new() - * for k, v in self._configs.items(): - * _k = k.encode("utf-8") # <<<<<<<<<<<<<< - * _v = v.encode("utf-8") - * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u_utf_8}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_XDECREF_SET(__pyx_v__k, __pyx_t_6); - __pyx_t_6 = 0; - - /* "taos/_objects.pyx":514 - * for k, v in self._configs.items(): - * _k = k.encode("utf-8") - * _v = v.encode("utf-8") # <<<<<<<<<<<<<< - * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) - * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u_utf_8}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_XDECREF_SET(__pyx_v__v, __pyx_t_6); - __pyx_t_6 = 0; - - /* "taos/_objects.pyx":515 - * _k = k.encode("utf-8") - * _v = v.encode("utf-8") - * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) # <<<<<<<<<<<<<< - * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: - * tmq_conf_destroy(self._tmq_conf) - */ - __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v__k); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v__v); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L1_error) - __pyx_v_tmq_conf_res = tmq_conf_set(__pyx_v_self->_tmq_conf, __pyx_t_9, __pyx_t_10); - - /* "taos/_objects.pyx":516 - * _v = v.encode("utf-8") - * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) - * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: # <<<<<<<<<<<<<< - * tmq_conf_destroy(self._tmq_conf) - * self._tmq_conf = NULL - */ - __pyx_t_11 = (__pyx_v_tmq_conf_res != TMQ_CONF_OK); - if (unlikely(__pyx_t_11)) { - - /* "taos/_objects.pyx":517 - * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) - * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: - * tmq_conf_destroy(self._tmq_conf) # <<<<<<<<<<<<<< - * self._tmq_conf = NULL - * raise Exception("set up tmq config failed!") - */ - tmq_conf_destroy(__pyx_v_self->_tmq_conf); - - /* "taos/_objects.pyx":518 - * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: - * tmq_conf_destroy(self._tmq_conf) - * self._tmq_conf = NULL # <<<<<<<<<<<<<< - * raise Exception("set up tmq config failed!") - * - */ - __pyx_v_self->_tmq_conf = NULL; - - /* "taos/_objects.pyx":519 - * tmq_conf_destroy(self._tmq_conf) - * self._tmq_conf = NULL - * raise Exception("set up tmq config failed!") # <<<<<<<<<<<<<< - * - * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) - */ - __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 519, __pyx_L1_error) - - /* "taos/_objects.pyx":516 - * _v = v.encode("utf-8") - * tmq_conf_res = tmq_conf_set(self._tmq_conf, _k, _v) - * if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: # <<<<<<<<<<<<<< - * tmq_conf_destroy(self._tmq_conf) - * self._tmq_conf = NULL - */ - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_objects.pyx":521 - * raise Exception("set up tmq config failed!") - * - * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) # <<<<<<<<<<<<<< - * if self._tmq is NULL: - * raise Exception("setup tmq failed") - */ - __pyx_v_self->_tmq = tmq_consumer_new(__pyx_v_self->_tmq_conf, NULL, 0); - - /* "taos/_objects.pyx":522 - * - * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) - * if self._tmq is NULL: # <<<<<<<<<<<<<< - * raise Exception("setup tmq failed") - * - */ - __pyx_t_11 = (__pyx_v_self->_tmq == NULL); - if (unlikely(__pyx_t_11)) { - - /* "taos/_objects.pyx":523 - * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) - * if self._tmq is NULL: - * raise Exception("setup tmq failed") # <<<<<<<<<<<<<< - * - * def subscribe(self, topics: list[str]): - */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 523, __pyx_L1_error) - - /* "taos/_objects.pyx":522 - * - * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) - * if self._tmq is NULL: # <<<<<<<<<<<<<< - * raise Exception("setup tmq failed") - * - */ - } - - /* "taos/_objects.pyx":509 - * cdef tmq_t *_tmq - * - * def __cinit__(self, configs: dict[str, str]): # <<<<<<<<<<<<<< - * self._configs = configs - * self._tmq_conf = tmq_conf_new() - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("taos._objects.TaosConsumer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_k); - __Pyx_XDECREF(__pyx_v_v); - __Pyx_XDECREF(__pyx_v__k); - __Pyx_XDECREF(__pyx_v__v); - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":525 - * raise Exception("setup tmq failed") - * - * def subscribe(self, topics: list[str]): # <<<<<<<<<<<<<< - * tmq_list = tmq_list_new() - * if tmq_list is NULL: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_3subscribe(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_2subscribe, "TaosConsumer.subscribe(self, list topics: list[str])"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_3subscribe = {"subscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_3subscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_2subscribe}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_3subscribe(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_topics = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("subscribe (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topics,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topics)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "subscribe") < 0)) __PYX_ERR(0, 525, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_topics = ((PyObject*)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("subscribe", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 525, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.subscribe", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topics), (&PyList_Type), 0, "topics", 1))) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_2subscribe(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topics); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_2subscribe(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topics) { - tmq_list_t *__pyx_v_tmq_list; - PyObject *__pyx_v_tp = NULL; - PyObject *__pyx_v__tp = NULL; - int32_t __pyx_v_tmq_errno; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - char const *__pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__44) - __Pyx_RefNannySetupContext("subscribe", 0); - __Pyx_TraceCall("subscribe", __pyx_f[0], 525, 0, __PYX_ERR(0, 525, __pyx_L1_error)); - - /* "taos/_objects.pyx":526 - * - * def subscribe(self, topics: list[str]): - * tmq_list = tmq_list_new() # <<<<<<<<<<<<<< - * if tmq_list is NULL: - * raise Exception("set up tmq list failed!") - */ - __pyx_v_tmq_list = tmq_list_new(); - - /* "taos/_objects.pyx":527 - * def subscribe(self, topics: list[str]): - * tmq_list = tmq_list_new() - * if tmq_list is NULL: # <<<<<<<<<<<<<< - * raise Exception("set up tmq list failed!") - * - */ - __pyx_t_1 = (__pyx_v_tmq_list == NULL); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":528 - * tmq_list = tmq_list_new() - * if tmq_list is NULL: - * raise Exception("set up tmq list failed!") # <<<<<<<<<<<<<< - * - * for tp in topics: - */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 528, __pyx_L1_error) - - /* "taos/_objects.pyx":527 - * def subscribe(self, topics: list[str]): - * tmq_list = tmq_list_new() - * if tmq_list is NULL: # <<<<<<<<<<<<<< - * raise Exception("set up tmq list failed!") - * - */ - } - - /* "taos/_objects.pyx":530 - * raise Exception("set up tmq list failed!") - * - * for tp in topics: # <<<<<<<<<<<<<< - * _tp = tp.encode("utf-8") - * tmq_errno = tmq_list_append(tmq_list, _tp) - */ - __pyx_t_2 = __pyx_v_topics; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - for (;;) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 530, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XDECREF_SET(__pyx_v_tp, __pyx_t_4); - __pyx_t_4 = 0; - - /* "taos/_objects.pyx":531 - * - * for tp in topics: - * _tp = tp.encode("utf-8") # <<<<<<<<<<<<<< - * tmq_errno = tmq_list_append(tmq_list, _tp) - * if tmq_errno != 0: - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tp, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_utf_8}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_XDECREF_SET(__pyx_v__tp, __pyx_t_4); - __pyx_t_4 = 0; - - /* "taos/_objects.pyx":532 - * for tp in topics: - * _tp = tp.encode("utf-8") - * tmq_errno = tmq_list_append(tmq_list, _tp) # <<<<<<<<<<<<<< - * if tmq_errno != 0: - * tmq_list_destroy(tmq_list) - */ - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v__tp); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error) - __pyx_v_tmq_errno = tmq_list_append(__pyx_v_tmq_list, __pyx_t_8); - - /* "taos/_objects.pyx":533 - * _tp = tp.encode("utf-8") - * tmq_errno = tmq_list_append(tmq_list, _tp) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * tmq_list_destroy(tmq_list) - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - __pyx_t_1 = (__pyx_v_tmq_errno != 0); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":534 - * tmq_errno = tmq_list_append(tmq_list, _tp) - * if tmq_errno != 0: - * tmq_list_destroy(tmq_list) # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - tmq_list_destroy(__pyx_v_tmq_list); - - /* "taos/_objects.pyx":535 - * if tmq_errno != 0: - * tmq_list_destroy(tmq_list) - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< - * - * tmq_errno = tmq_subscribe(self._tmq, tmq_list) - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_6, __pyx_t_9}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 535, __pyx_L1_error) - - /* "taos/_objects.pyx":533 - * _tp = tp.encode("utf-8") - * tmq_errno = tmq_list_append(tmq_list, _tp) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * tmq_list_destroy(tmq_list) - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - } - - /* "taos/_objects.pyx":530 - * raise Exception("set up tmq list failed!") - * - * for tp in topics: # <<<<<<<<<<<<<< - * _tp = tp.encode("utf-8") - * tmq_errno = tmq_list_append(tmq_list, _tp) - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":537 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * tmq_errno = tmq_subscribe(self._tmq, tmq_list) # <<<<<<<<<<<<<< - * if tmq_errno != 0: - * tmq_list_destroy(tmq_list) - */ - __pyx_v_tmq_errno = tmq_subscribe(__pyx_v_self->_tmq, __pyx_v_tmq_list); - - /* "taos/_objects.pyx":538 - * - * tmq_errno = tmq_subscribe(self._tmq, tmq_list) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * tmq_list_destroy(tmq_list) - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - __pyx_t_1 = (__pyx_v_tmq_errno != 0); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":539 - * tmq_errno = tmq_subscribe(self._tmq, tmq_list) - * if tmq_errno != 0: - * tmq_list_destroy(tmq_list) # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - tmq_list_destroy(__pyx_v_tmq_list); - - /* "taos/_objects.pyx":540 - * if tmq_errno != 0: - * tmq_list_destroy(tmq_list) - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< - * - * def unsubscribe(self): - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_9}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 540, __pyx_L1_error) - - /* "taos/_objects.pyx":538 - * - * tmq_errno = tmq_subscribe(self._tmq, tmq_list) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * tmq_list_destroy(tmq_list) - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - } - - /* "taos/_objects.pyx":525 - * raise Exception("setup tmq failed") - * - * def subscribe(self, topics: list[str]): # <<<<<<<<<<<<<< - * tmq_list = tmq_list_new() - * if tmq_list is NULL: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("taos._objects.TaosConsumer.subscribe", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_tp); - __Pyx_XDECREF(__pyx_v__tp); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":542 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def unsubscribe(self): # <<<<<<<<<<<<<< - * tmq_errno = tmq_unsubscribe(self._tmq) - * if tmq_errno != 0: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_5unsubscribe(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_4unsubscribe, "TaosConsumer.unsubscribe(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_5unsubscribe = {"unsubscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_5unsubscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_4unsubscribe}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_5unsubscribe(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("unsubscribe (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("unsubscribe", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "unsubscribe", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_4unsubscribe(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_4unsubscribe(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self) { - int32_t __pyx_v_tmq_errno; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__46) - __Pyx_RefNannySetupContext("unsubscribe", 0); - __Pyx_TraceCall("unsubscribe", __pyx_f[0], 542, 0, __PYX_ERR(0, 542, __pyx_L1_error)); - - /* "taos/_objects.pyx":543 - * - * def unsubscribe(self): - * tmq_errno = tmq_unsubscribe(self._tmq) # <<<<<<<<<<<<<< - * if tmq_errno != 0: - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - __pyx_v_tmq_errno = tmq_unsubscribe(__pyx_v_self->_tmq); - - /* "taos/_objects.pyx":544 - * def unsubscribe(self): - * tmq_errno = tmq_unsubscribe(self._tmq) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - __pyx_t_1 = (__pyx_v_tmq_errno != 0); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":545 - * tmq_errno = tmq_unsubscribe(self._tmq) - * if tmq_errno != 0: - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< - * - * def poll(self, timeout: int): - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 545, __pyx_L1_error) - - /* "taos/_objects.pyx":544 - * def unsubscribe(self): - * tmq_errno = tmq_unsubscribe(self._tmq) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - } - - /* "taos/_objects.pyx":542 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def unsubscribe(self): # <<<<<<<<<<<<<< - * tmq_errno = tmq_unsubscribe(self._tmq) - * if tmq_errno != 0: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("taos._objects.TaosConsumer.unsubscribe", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":547 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def poll(self, timeout: int): # <<<<<<<<<<<<<< - * res = tmq_consumer_poll(self._tmq, timeout) - * if res is NULL: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_7poll(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_6poll, "TaosConsumer.poll(self, int timeout: int)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_7poll = {"poll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_7poll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_6poll}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_7poll(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_timeout = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("poll (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "poll") < 0)) __PYX_ERR(0, 547, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_timeout = ((PyObject*)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("poll", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 547, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_timeout), (&PyInt_Type), 0, "timeout", 1))) __PYX_ERR(0, 547, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_6poll(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_timeout); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_6poll(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_timeout) { - TAOS_RES *__pyx_v_res; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int64_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__47) - __Pyx_RefNannySetupContext("poll", 0); - __Pyx_TraceCall("poll", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error)); - - /* "taos/_objects.pyx":548 - * - * def poll(self, timeout: int): - * res = tmq_consumer_poll(self._tmq, timeout) # <<<<<<<<<<<<<< - * if res is NULL: - * return None - */ - __pyx_t_1 = __Pyx_PyInt_As_int64_t(__pyx_v_timeout); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L1_error) - __pyx_v_res = tmq_consumer_poll(__pyx_v_self->_tmq, __pyx_t_1); - - /* "taos/_objects.pyx":549 - * def poll(self, timeout: int): - * res = tmq_consumer_poll(self._tmq, timeout) - * if res is NULL: # <<<<<<<<<<<<<< - * return None - * - */ - __pyx_t_2 = (__pyx_v_res == NULL); - if (__pyx_t_2) { - - /* "taos/_objects.pyx":550 - * res = tmq_consumer_poll(self._tmq, timeout) - * if res is NULL: - * return None # <<<<<<<<<<<<<< - * - * return TaosResult(res) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "taos/_objects.pyx":549 - * def poll(self, timeout: int): - * res = tmq_consumer_poll(self._tmq, timeout) - * if res is NULL: # <<<<<<<<<<<<<< - * return None - * - */ - } - - /* "taos/_objects.pyx":552 - * return None - * - * return TaosResult(res) # <<<<<<<<<<<<<< - * - * def commit(self, taos_res: TaosResult): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_res)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":547 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def poll(self, timeout: int): # <<<<<<<<<<<<<< - * res = tmq_consumer_poll(self._tmq, timeout) - * if res is NULL: - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("taos._objects.TaosConsumer.poll", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":554 - * return TaosResult(res) - * - * def commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * self.result_commit(taos_res) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_9commit(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_8commit, "TaosConsumer.commit(self, TaosResult taos_res: TaosResult)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_9commit = {"commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_9commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_8commit}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_9commit(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("commit (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "commit") < 0)) __PYX_ERR(0, 554, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("commit", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 554, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.commit", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 554, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_8commit(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_8commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__48) - __Pyx_RefNannySetupContext("commit", 0); - __Pyx_TraceCall("commit", __pyx_f[0], 554, 0, __PYX_ERR(0, 554, __pyx_L1_error)); - - /* "taos/_objects.pyx":555 - * - * def commit(self, taos_res: TaosResult): - * self.result_commit(taos_res) # <<<<<<<<<<<<<< - * - * def result_commit(self, taos_res: TaosResult): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_result_commit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_taos_res)}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_objects.pyx":554 - * return TaosResult(res) - * - * def commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * self.result_commit(taos_res) - * - */ - - /* 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("taos._objects.TaosConsumer.commit", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":557 - * self.result_commit(taos_res) - * - * def result_commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) - * if tmq_errno != 0: - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_11result_commit(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_10result_commit, "TaosConsumer.result_commit(self, TaosResult taos_res: TaosResult)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_11result_commit = {"result_commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_11result_commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_10result_commit}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_11result_commit(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("result_commit (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 557, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "result_commit") < 0)) __PYX_ERR(0, 557, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("result_commit", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 557, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.result_commit", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 557, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_10result_commit(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_10result_commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { - int32_t __pyx_v_tmq_errno; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__49) - __Pyx_RefNannySetupContext("result_commit", 0); - __Pyx_TraceCall("result_commit", __pyx_f[0], 557, 0, __PYX_ERR(0, 557, __pyx_L1_error)); - - /* "taos/_objects.pyx":558 - * - * def result_commit(self, taos_res: TaosResult): - * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) # <<<<<<<<<<<<<< - * if tmq_errno != 0: - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - __pyx_v_tmq_errno = tmq_commit_sync(__pyx_v_self->_tmq, __pyx_v_taos_res->_res); - - /* "taos/_objects.pyx":559 - * def result_commit(self, taos_res: TaosResult): - * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - __pyx_t_1 = (__pyx_v_tmq_errno != 0); - if (unlikely(__pyx_t_1)) { - - /* "taos/_objects.pyx":560 - * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) - * if tmq_errno != 0: - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< - * - * def offset_commit(self, topic: str, vg_id: int, offset: int): - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_7 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 560, __pyx_L1_error) - - /* "taos/_objects.pyx":559 - * def result_commit(self, taos_res: TaosResult): - * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - } - - /* "taos/_objects.pyx":557 - * self.result_commit(taos_res) - * - * def result_commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) - * if tmq_errno != 0: - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("taos._objects.TaosConsumer.result_commit", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":562 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def offset_commit(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_13offset_commit(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_12offset_commit, "TaosConsumer.offset_commit(self, unicode topic: str, int vg_id: int, int offset: int)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_13offset_commit = {"offset_commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_13offset_commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_12offset_commit}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_13offset_commit(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_topic = 0; - PyObject *__pyx_v_vg_id = 0; - PyObject *__pyx_v_offset = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("offset_commit (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,&__pyx_n_s_vg_id,&__pyx_n_s_offset,0}; - PyObject* values[3] = {0,0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("offset_commit", 1, 3, 3, 1); __PYX_ERR(0, 562, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("offset_commit", 1, 3, 3, 2); __PYX_ERR(0, 562, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "offset_commit") < 0)) __PYX_ERR(0, 562, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_topic = ((PyObject*)values[0]); - __pyx_v_vg_id = ((PyObject*)values[1]); - __pyx_v_offset = ((PyObject*)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("offset_commit", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 562, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.offset_commit", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 562, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg_id), (&PyInt_Type), 0, "vg_id", 1))) __PYX_ERR(0, 562, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_offset), (&PyInt_Type), 0, "offset", 1))) __PYX_ERR(0, 562, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_12offset_commit(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic, __pyx_v_vg_id, __pyx_v_offset); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_12offset_commit(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id, PyObject *__pyx_v_offset) { - PyObject *__pyx_v__topic = NULL; - int32_t __pyx_v_tmq_errno; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - char const *__pyx_t_2; - int32_t __pyx_t_3; - int64_t __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__50) - __Pyx_RefNannySetupContext("offset_commit", 0); - __Pyx_TraceCall("offset_commit", __pyx_f[0], 562, 0, __PYX_ERR(0, 562, __pyx_L1_error)); - - /* "taos/_objects.pyx":563 - * - * def offset_commit(self, topic: str, vg_id: int, offset: int): - * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< - * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) - * if tmq_errno != 0: - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__topic = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":564 - * def offset_commit(self, topic: str, vg_id: int, offset: int): - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) # <<<<<<<<<<<<<< - * if tmq_errno != 0: - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_vg_id); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 564, __pyx_L1_error) - __pyx_v_tmq_errno = tmq_commit_offset_sync(__pyx_v_self->_tmq, __pyx_t_2, __pyx_t_3, __pyx_t_4); - - /* "taos/_objects.pyx":565 - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - __pyx_t_5 = (__pyx_v_tmq_errno != 0); - if (unlikely(__pyx_t_5)) { - - /* "taos/_objects.pyx":566 - * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) - * if tmq_errno != 0: - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< - * - * def get_topic_assignment(self, topic: str): - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = NULL; - __pyx_t_10 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_10 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 566, __pyx_L1_error) - - /* "taos/_objects.pyx":565 - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - } - - /* "taos/_objects.pyx":562 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def offset_commit(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("taos._objects.TaosConsumer.offset_commit", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__topic); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":568 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def get_topic_assignment(self, topic: str): # <<<<<<<<<<<<<< - * cdef int32_t num_of_assignment - * cdef tmq_topic_assignment *assignment_ptr = NULL - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_15get_topic_assignment(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_14get_topic_assignment, "TaosConsumer.get_topic_assignment(self, unicode topic: str)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_15get_topic_assignment = {"get_topic_assignment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_15get_topic_assignment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_14get_topic_assignment}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_15get_topic_assignment(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_topic = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_topic_assignment (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 568, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_topic_assignment") < 0)) __PYX_ERR(0, 568, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_topic = ((PyObject*)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_topic_assignment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 568, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_topic_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 568, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_14get_topic_assignment(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_14get_topic_assignment(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic) { - int32_t __pyx_v_num_of_assignment; - tmq_topic_assignment *__pyx_v_assignment_ptr; - PyObject *__pyx_v__topic = NULL; - int32_t __pyx_v_tmq_errno; - tmq_topic_assignment *__pyx_v_assignment; - PyObject *__pyx_v_topic_assignments = NULL; - int32_t __pyx_v_i; - struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *__pyx_v_tta = NULL; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - char const *__pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int32_t __pyx_t_9; - int32_t __pyx_t_10; - int32_t __pyx_t_11; - int __pyx_t_12; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__51) - __Pyx_RefNannySetupContext("get_topic_assignment", 0); - __Pyx_TraceCall("get_topic_assignment", __pyx_f[0], 568, 0, __PYX_ERR(0, 568, __pyx_L1_error)); - - /* "taos/_objects.pyx":570 - * def get_topic_assignment(self, topic: str): - * cdef int32_t num_of_assignment - * cdef tmq_topic_assignment *assignment_ptr = NULL # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) - */ - __pyx_v_assignment_ptr = NULL; - - /* "taos/_objects.pyx":571 - * cdef int32_t num_of_assignment - * cdef tmq_topic_assignment *assignment_ptr = NULL - * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< - * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) - * if tmq_errno != 0: - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__topic = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":572 - * cdef tmq_topic_assignment *assignment_ptr = NULL - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) # <<<<<<<<<<<<<< - * if tmq_errno != 0: - * tmq_free_assignment(assignment_ptr) - */ - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L1_error) - __pyx_v_tmq_errno = tmq_get_topic_assignment(__pyx_v_self->_tmq, __pyx_t_2, (&__pyx_v_assignment_ptr), (&__pyx_v_num_of_assignment)); - - /* "taos/_objects.pyx":573 - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * tmq_free_assignment(assignment_ptr) - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - __pyx_t_3 = (__pyx_v_tmq_errno != 0); - if (unlikely(__pyx_t_3)) { - - /* "taos/_objects.pyx":574 - * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) - * if tmq_errno != 0: - * tmq_free_assignment(assignment_ptr) # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - tmq_free_assignment(__pyx_v_assignment_ptr); - - /* "taos/_objects.pyx":575 - * if tmq_errno != 0: - * tmq_free_assignment(assignment_ptr) - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< - * - * cdef tmq_topic_assignment *assignment - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_8 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 575, __pyx_L1_error) - - /* "taos/_objects.pyx":573 - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * tmq_free_assignment(assignment_ptr) - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - } - - /* "taos/_objects.pyx":578 - * - * cdef tmq_topic_assignment *assignment - * topic_assignments = [] # <<<<<<<<<<<<<< - * for i in range(num_of_assignment): - * assignment = &assignment_ptr[i] - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_topic_assignments = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":579 - * cdef tmq_topic_assignment *assignment - * topic_assignments = [] - * for i in range(num_of_assignment): # <<<<<<<<<<<<<< - * assignment = &assignment_ptr[i] - * tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) - */ - __pyx_t_9 = __pyx_v_num_of_assignment; - __pyx_t_10 = __pyx_t_9; - for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { - __pyx_v_i = __pyx_t_11; - - /* "taos/_objects.pyx":580 - * topic_assignments = [] - * for i in range(num_of_assignment): - * assignment = &assignment_ptr[i] # <<<<<<<<<<<<<< - * tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) - * topic_assignments.append(tta) - */ - __pyx_v_assignment = (&(__pyx_v_assignment_ptr[__pyx_v_i])); - - /* "taos/_objects.pyx":581 - * for i in range(num_of_assignment): - * assignment = &assignment_ptr[i] - * tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) # <<<<<<<<<<<<<< - * topic_assignments.append(tta) - * - */ - __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_assignment->vgId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_assignment->currentOffset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_assignment->begin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_assignment->end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5); - __pyx_t_1 = 0; - __pyx_t_4 = 0; - __pyx_t_6 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4taos_8_objects_TaosTopicAssignment), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF_SET(__pyx_v_tta, ((struct __pyx_obj_4taos_8_objects_TaosTopicAssignment *)__pyx_t_5)); - __pyx_t_5 = 0; - - /* "taos/_objects.pyx":582 - * assignment = &assignment_ptr[i] - * tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) - * topic_assignments.append(tta) # <<<<<<<<<<<<<< - * - * tmq_free_assignment(assignment_ptr) - */ - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_topic_assignments, ((PyObject *)__pyx_v_tta)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 582, __pyx_L1_error) - } - - /* "taos/_objects.pyx":584 - * topic_assignments.append(tta) - * - * tmq_free_assignment(assignment_ptr) # <<<<<<<<<<<<<< - * - * return topic_assignments - */ - tmq_free_assignment(__pyx_v_assignment_ptr); - - /* "taos/_objects.pyx":586 - * tmq_free_assignment(assignment_ptr) - * - * return topic_assignments # <<<<<<<<<<<<<< - * - * def offset_seek(self, topic: str, vg_id: int, offset: int): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_topic_assignments); - __pyx_r = __pyx_v_topic_assignments; - goto __pyx_L0; - - /* "taos/_objects.pyx":568 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def get_topic_assignment(self, topic: str): # <<<<<<<<<<<<<< - * cdef int32_t num_of_assignment - * cdef tmq_topic_assignment *assignment_ptr = NULL - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_topic_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__topic); - __Pyx_XDECREF(__pyx_v_topic_assignments); - __Pyx_XDECREF((PyObject *)__pyx_v_tta); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":588 - * return topic_assignments - * - * def offset_seek(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_17offset_seek(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_16offset_seek, "TaosConsumer.offset_seek(self, unicode topic: str, int vg_id: int, int offset: int)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_17offset_seek = {"offset_seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_17offset_seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_16offset_seek}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_17offset_seek(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_topic = 0; - PyObject *__pyx_v_vg_id = 0; - PyObject *__pyx_v_offset = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("offset_seek (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,&__pyx_n_s_vg_id,&__pyx_n_s_offset,0}; - PyObject* values[3] = {0,0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("offset_seek", 1, 3, 3, 1); __PYX_ERR(0, 588, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("offset_seek", 1, 3, 3, 2); __PYX_ERR(0, 588, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "offset_seek") < 0)) __PYX_ERR(0, 588, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_topic = ((PyObject*)values[0]); - __pyx_v_vg_id = ((PyObject*)values[1]); - __pyx_v_offset = ((PyObject*)values[2]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("offset_seek", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 588, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.offset_seek", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 588, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg_id), (&PyInt_Type), 0, "vg_id", 1))) __PYX_ERR(0, 588, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_offset), (&PyInt_Type), 0, "offset", 1))) __PYX_ERR(0, 588, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_16offset_seek(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic, __pyx_v_vg_id, __pyx_v_offset); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_16offset_seek(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id, PyObject *__pyx_v_offset) { - PyObject *__pyx_v__topic = NULL; - int32_t __pyx_v_tmq_errno; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - char const *__pyx_t_2; - int32_t __pyx_t_3; - int64_t __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__52) - __Pyx_RefNannySetupContext("offset_seek", 0); - __Pyx_TraceCall("offset_seek", __pyx_f[0], 588, 0, __PYX_ERR(0, 588, __pyx_L1_error)); - - /* "taos/_objects.pyx":589 - * - * def offset_seek(self, topic: str, vg_id: int, offset: int): - * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< - * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) - * if tmq_errno != 0: - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__topic = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":590 - * def offset_seek(self, topic: str, vg_id: int, offset: int): - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) # <<<<<<<<<<<<<< - * if tmq_errno != 0: - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - */ - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_vg_id); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 590, __pyx_L1_error) - __pyx_v_tmq_errno = tmq_offset_seek(__pyx_v_self->_tmq, __pyx_t_2, __pyx_t_3, __pyx_t_4); - - /* "taos/_objects.pyx":591 - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - __pyx_t_5 = (__pyx_v_tmq_errno != 0); - if (unlikely(__pyx_t_5)) { - - /* "taos/_objects.pyx":592 - * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) - * if tmq_errno != 0: - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) # <<<<<<<<<<<<<< - * - * def position(self, topic: str, vg_id: int): - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_tmq_errno)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_tmq_errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = NULL; - __pyx_t_10 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_10 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 592, __pyx_L1_error) - - /* "taos/_objects.pyx":591 - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) - * if tmq_errno != 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - */ - } - - /* "taos/_objects.pyx":588 - * return topic_assignments - * - * def offset_seek(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("taos._objects.TaosConsumer.offset_seek", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__topic); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":594 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def position(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * pos = tmq_position(self._tmq, _topic, vg_id) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_19position(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_18position, "TaosConsumer.position(self, unicode topic: str, int vg_id: int)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_19position = {"position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_19position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_18position}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_19position(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_topic = 0; - PyObject *__pyx_v_vg_id = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("position (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,&__pyx_n_s_vg_id,0}; - PyObject* values[2] = {0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("position", 1, 2, 2, 1); __PYX_ERR(0, 594, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "position") < 0)) __PYX_ERR(0, 594, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_topic = ((PyObject*)values[0]); - __pyx_v_vg_id = ((PyObject*)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("position", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 594, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.position", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 594, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg_id), (&PyInt_Type), 0, "vg_id", 1))) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_18position(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic, __pyx_v_vg_id); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_18position(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id) { - PyObject *__pyx_v__topic = NULL; - int64_t __pyx_v_pos; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - char const *__pyx_t_2; - int32_t __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__53) - __Pyx_RefNannySetupContext("position", 0); - __Pyx_TraceCall("position", __pyx_f[0], 594, 0, __PYX_ERR(0, 594, __pyx_L1_error)); - - /* "taos/_objects.pyx":595 - * - * def position(self, topic: str, vg_id: int): - * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< - * pos = tmq_position(self._tmq, _topic, vg_id) - * if pos < 0: - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__topic = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":596 - * def position(self, topic: str, vg_id: int): - * _topic = topic.encode("utf-8") - * pos = tmq_position(self._tmq, _topic, vg_id) # <<<<<<<<<<<<<< - * if pos < 0: - * raise TmqError(tmq_err2str(pos), pos) - */ - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_vg_id); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L1_error) - __pyx_v_pos = tmq_position(__pyx_v_self->_tmq, __pyx_t_2, __pyx_t_3); - - /* "taos/_objects.pyx":597 - * _topic = topic.encode("utf-8") - * pos = tmq_position(self._tmq, _topic, vg_id) - * if pos < 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(pos), pos) - * - */ - __pyx_t_4 = (__pyx_v_pos < 0); - if (unlikely(__pyx_t_4)) { - - /* "taos/_objects.pyx":598 - * pos = tmq_position(self._tmq, _topic, vg_id) - * if pos < 0: - * raise TmqError(tmq_err2str(pos), pos) # <<<<<<<<<<<<<< - * - * return pos - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_pos)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_pos); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_9 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 598, __pyx_L1_error) - - /* "taos/_objects.pyx":597 - * _topic = topic.encode("utf-8") - * pos = tmq_position(self._tmq, _topic, vg_id) - * if pos < 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(pos), pos) - * - */ - } - - /* "taos/_objects.pyx":600 - * raise TmqError(tmq_err2str(pos), pos) - * - * return pos # <<<<<<<<<<<<<< - * - * def committed(self, topic: str, vg_id: int): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":594 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def position(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * pos = tmq_position(self._tmq, _topic, vg_id) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("taos._objects.TaosConsumer.position", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__topic); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":602 - * return pos - * - * def committed(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * offset = tmq_committed(self._tmq, _topic, vg_id) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_21committed(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_20committed, "TaosConsumer.committed(self, unicode topic: str, int vg_id: int)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_21committed = {"committed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_21committed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_20committed}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_21committed(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_topic = 0; - PyObject *__pyx_v_vg_id = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("committed (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_topic,&__pyx_n_s_vg_id,0}; - PyObject* values[2] = {0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_topic)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vg_id)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("committed", 1, 2, 2, 1); __PYX_ERR(0, 602, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "committed") < 0)) __PYX_ERR(0, 602, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_topic = ((PyObject*)values[0]); - __pyx_v_vg_id = ((PyObject*)values[1]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("committed", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 602, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.committed", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_topic), (&PyUnicode_Type), 0, "topic", 1))) __PYX_ERR(0, 602, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg_id), (&PyInt_Type), 0, "vg_id", 1))) __PYX_ERR(0, 602, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_20committed(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_topic, __pyx_v_vg_id); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_20committed(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, PyObject *__pyx_v_topic, PyObject *__pyx_v_vg_id) { - PyObject *__pyx_v__topic = NULL; - int64_t __pyx_v_offset; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - char const *__pyx_t_2; - int32_t __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__54) - __Pyx_RefNannySetupContext("committed", 0); - __Pyx_TraceCall("committed", __pyx_f[0], 602, 0, __PYX_ERR(0, 602, __pyx_L1_error)); - - /* "taos/_objects.pyx":603 - * - * def committed(self, topic: str, vg_id: int): - * _topic = topic.encode("utf-8") # <<<<<<<<<<<<<< - * offset = tmq_committed(self._tmq, _topic, vg_id) - * if offset == -2147467247: - */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_topic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v__topic = __pyx_t_1; - __pyx_t_1 = 0; - - /* "taos/_objects.pyx":604 - * def committed(self, topic: str, vg_id: int): - * _topic = topic.encode("utf-8") - * offset = tmq_committed(self._tmq, _topic, vg_id) # <<<<<<<<<<<<<< - * if offset == -2147467247: - * return None - */ - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v__topic); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_vg_id); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error) - __pyx_v_offset = tmq_committed(__pyx_v_self->_tmq, __pyx_t_2, __pyx_t_3); - - /* "taos/_objects.pyx":605 - * _topic = topic.encode("utf-8") - * offset = tmq_committed(self._tmq, _topic, vg_id) - * if offset == -2147467247: # <<<<<<<<<<<<<< - * return None - * - */ - __pyx_t_4 = (__pyx_v_offset == -2147467247L); - if (__pyx_t_4) { - - /* "taos/_objects.pyx":606 - * offset = tmq_committed(self._tmq, _topic, vg_id) - * if offset == -2147467247: - * return None # <<<<<<<<<<<<<< - * - * if offset < 0: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - - /* "taos/_objects.pyx":605 - * _topic = topic.encode("utf-8") - * offset = tmq_committed(self._tmq, _topic, vg_id) - * if offset == -2147467247: # <<<<<<<<<<<<<< - * return None - * - */ - } - - /* "taos/_objects.pyx":608 - * return None - * - * if offset < 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(offset), offset) - * - */ - __pyx_t_4 = (__pyx_v_offset < 0); - if (unlikely(__pyx_t_4)) { - - /* "taos/_objects.pyx":609 - * - * if offset < 0: - * raise TmqError(tmq_err2str(offset), offset) # <<<<<<<<<<<<<< - * - * return offset - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyBytes_FromString(tmq_err2str(__pyx_v_offset)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_9 = 1; - } - } - { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 609, __pyx_L1_error) - - /* "taos/_objects.pyx":608 - * return None - * - * if offset < 0: # <<<<<<<<<<<<<< - * raise TmqError(tmq_err2str(offset), offset) - * - */ - } - - /* "taos/_objects.pyx":611 - * raise TmqError(tmq_err2str(offset), offset) - * - * return offset # <<<<<<<<<<<<<< - * - * def get_topic_name(self, taos_res: TaosResult): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":602 - * return pos - * - * def committed(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * offset = tmq_committed(self._tmq, _topic, vg_id) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("taos._objects.TaosConsumer.committed", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__topic); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":613 - * return offset - * - * def get_topic_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_topic_name(taos_res._res) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_23get_topic_name(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_22get_topic_name, "TaosConsumer.get_topic_name(self, TaosResult taos_res: TaosResult)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_23get_topic_name = {"get_topic_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_23get_topic_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_22get_topic_name}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_23get_topic_name(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_topic_name (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 613, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_topic_name") < 0)) __PYX_ERR(0, 613, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_topic_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 613, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_topic_name", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 613, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_22get_topic_name(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_22get_topic_name(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__55) - __Pyx_RefNannySetupContext("get_topic_name", 0); - __Pyx_TraceCall("get_topic_name", __pyx_f[0], 613, 0, __PYX_ERR(0, 613, __pyx_L1_error)); - - /* "taos/_objects.pyx":614 - * - * def get_topic_name(self, taos_res: TaosResult): - * return tmq_get_topic_name(taos_res._res) # <<<<<<<<<<<<<< - * - * def get_db_name(self, taos_res: TaosResult): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBytes_FromString(tmq_get_topic_name(__pyx_v_taos_res->_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":613 - * return offset - * - * def get_topic_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_topic_name(taos_res._res) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_topic_name", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":616 - * return tmq_get_topic_name(taos_res._res) - * - * def get_db_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_db_name(taos_res._res) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_25get_db_name(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_24get_db_name, "TaosConsumer.get_db_name(self, TaosResult taos_res: TaosResult)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_25get_db_name = {"get_db_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_25get_db_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_24get_db_name}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_25get_db_name(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_db_name (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 616, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_db_name") < 0)) __PYX_ERR(0, 616, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_db_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 616, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_db_name", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 616, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_24get_db_name(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_24get_db_name(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__56) - __Pyx_RefNannySetupContext("get_db_name", 0); - __Pyx_TraceCall("get_db_name", __pyx_f[0], 616, 0, __PYX_ERR(0, 616, __pyx_L1_error)); - - /* "taos/_objects.pyx":617 - * - * def get_db_name(self, taos_res: TaosResult): - * return tmq_get_db_name(taos_res._res) # <<<<<<<<<<<<<< - * - * def get_vgroup_id(self, taos_res: TaosResult): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBytes_FromString(tmq_get_db_name(__pyx_v_taos_res->_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":616 - * return tmq_get_topic_name(taos_res._res) - * - * def get_db_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_db_name(taos_res._res) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_db_name", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":619 - * return tmq_get_db_name(taos_res._res) - * - * def get_vgroup_id(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_vgroup_id(taos_res._res) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_27get_vgroup_id(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_26get_vgroup_id, "TaosConsumer.get_vgroup_id(self, TaosResult taos_res: TaosResult)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_27get_vgroup_id = {"get_vgroup_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_27get_vgroup_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_26get_vgroup_id}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_27get_vgroup_id(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_vgroup_id (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_vgroup_id") < 0)) __PYX_ERR(0, 619, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_vgroup_id", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 619, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_vgroup_id", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 619, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_26get_vgroup_id(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_26get_vgroup_id(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__57) - __Pyx_RefNannySetupContext("get_vgroup_id", 0); - __Pyx_TraceCall("get_vgroup_id", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error)); - - /* "taos/_objects.pyx":620 - * - * def get_vgroup_id(self, taos_res: TaosResult): - * return tmq_get_vgroup_id(taos_res._res) # <<<<<<<<<<<<<< - * - * def get_vgroup_offset(self, taos_res: TaosResult): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int32_t(tmq_get_vgroup_id(__pyx_v_taos_res->_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":619 - * return tmq_get_db_name(taos_res._res) - * - * def get_vgroup_id(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_vgroup_id(taos_res._res) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_vgroup_id", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":622 - * return tmq_get_vgroup_id(taos_res._res) - * - * def get_vgroup_offset(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_vgroup_offset(taos_res._res) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_29get_vgroup_offset(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_28get_vgroup_offset, "TaosConsumer.get_vgroup_offset(self, TaosResult taos_res: TaosResult)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_29get_vgroup_offset = {"get_vgroup_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_29get_vgroup_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_28get_vgroup_offset}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_29get_vgroup_offset(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_vgroup_offset (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_taos_res,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_taos_res)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_vgroup_offset") < 0)) __PYX_ERR(0, 622, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_taos_res = ((struct __pyx_obj_4taos_8_objects_TaosResult *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_vgroup_offset", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 622, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_vgroup_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_taos_res), __pyx_ptype_4taos_8_objects_TaosResult, 0, "taos_res", 0))) __PYX_ERR(0, 622, __pyx_L1_error) - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_28get_vgroup_offset(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v_taos_res); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_28get_vgroup_offset(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, struct __pyx_obj_4taos_8_objects_TaosResult *__pyx_v_taos_res) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__58) - __Pyx_RefNannySetupContext("get_vgroup_offset", 0); - __Pyx_TraceCall("get_vgroup_offset", __pyx_f[0], 622, 0, __PYX_ERR(0, 622, __pyx_L1_error)); - - /* "taos/_objects.pyx":623 - * - * def get_vgroup_offset(self, taos_res: TaosResult): - * return tmq_get_vgroup_offset(taos_res._res) # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int64_t(tmq_get_vgroup_offset(__pyx_v_taos_res->_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "taos/_objects.pyx":622 - * return tmq_get_vgroup_id(taos_res._res) - * - * def get_vgroup_offset(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_vgroup_offset(taos_res._res) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._objects.TaosConsumer.get_vgroup_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_objects.pyx":625 - * return tmq_get_vgroup_offset(taos_res._res) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._tmq_conf is not NULL: - * tmq_conf_destroy(self._tmq_conf) - */ - -/* Python wrapper */ -static void __pyx_pw_4taos_8_objects_12TaosConsumer_31__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_4taos_8_objects_12TaosConsumer_31__dealloc__(PyObject *__pyx_v_self) { - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_4taos_8_objects_12TaosConsumer_30__dealloc__(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_4taos_8_objects_12TaosConsumer_30__dealloc__(struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self) { - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__dealloc__", 0); - __Pyx_TraceCall("__dealloc__", __pyx_f[0], 625, 0, __PYX_ERR(0, 625, __pyx_L1_error)); - - /* "taos/_objects.pyx":626 - * - * def __dealloc__(self): - * if self._tmq_conf is not NULL: # <<<<<<<<<<<<<< - * tmq_conf_destroy(self._tmq_conf) - * self._tmq_conf = NULL - */ - __pyx_t_1 = (__pyx_v_self->_tmq_conf != NULL); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":627 - * def __dealloc__(self): - * if self._tmq_conf is not NULL: - * tmq_conf_destroy(self._tmq_conf) # <<<<<<<<<<<<<< - * self._tmq_conf = NULL - * - */ - tmq_conf_destroy(__pyx_v_self->_tmq_conf); - - /* "taos/_objects.pyx":628 - * if self._tmq_conf is not NULL: - * tmq_conf_destroy(self._tmq_conf) - * self._tmq_conf = NULL # <<<<<<<<<<<<<< - * - * if self._tmq is not NULL: - */ - __pyx_v_self->_tmq_conf = NULL; - - /* "taos/_objects.pyx":626 - * - * def __dealloc__(self): - * if self._tmq_conf is not NULL: # <<<<<<<<<<<<<< - * tmq_conf_destroy(self._tmq_conf) - * self._tmq_conf = NULL - */ - } - - /* "taos/_objects.pyx":630 - * self._tmq_conf = NULL - * - * if self._tmq is not NULL: # <<<<<<<<<<<<<< - * tmq_consumer_close(self._tmq) - * self._tmq = NULL - */ - __pyx_t_1 = (__pyx_v_self->_tmq != NULL); - if (__pyx_t_1) { - - /* "taos/_objects.pyx":631 - * - * if self._tmq is not NULL: - * tmq_consumer_close(self._tmq) # <<<<<<<<<<<<<< - * self._tmq = NULL - * - */ - (void)(tmq_consumer_close(__pyx_v_self->_tmq)); - - /* "taos/_objects.pyx":632 - * if self._tmq is not NULL: - * tmq_consumer_close(self._tmq) - * self._tmq = NULL # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_self->_tmq = NULL; - - /* "taos/_objects.pyx":630 - * self._tmq_conf = NULL - * - * if self._tmq is not NULL: # <<<<<<<<<<<<<< - * tmq_consumer_close(self._tmq) - * self._tmq = NULL - */ - } - - /* "taos/_objects.pyx":625 - * return tmq_get_vgroup_offset(taos_res._res) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._tmq_conf is not NULL: - * tmq_conf_destroy(self._tmq_conf) - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_WriteUnraisable("taos._objects.TaosConsumer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); -} - -/* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_33__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_32__reduce_cython__, "TaosConsumer.__reduce_cython__(self)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_32__reduce_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_33__reduce_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - if (unlikely(__pyx_nargs > 0)) { - __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} - if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_32__reduce_cython__(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__59) - __Pyx_RefNannySetupContext("__reduce_cython__", 0); - __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); - - /* "(tree fragment)":2 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 2, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_35__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_12TaosConsumer_34__setstate_cython__, "TaosConsumer.__setstate_cython__(self, __pyx_state)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_12TaosConsumer_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_34__setstate_cython__}; -static PyObject *__pyx_pw_4taos_8_objects_12TaosConsumer_35__setstate_cython__(PyObject *__pyx_v_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; - PyObject* values[1] = {0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v___pyx_state = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_12TaosConsumer_34__setstate_cython__(((struct __pyx_obj_4taos_8_objects_TaosConsumer *)__pyx_v_self), __pyx_v___pyx_state); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_12TaosConsumer_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4taos_8_objects_TaosConsumer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__60) - __Pyx_RefNannySetupContext("__setstate_cython__", 0); - __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); - - /* "(tree fragment)":4 - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< - */ - __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); - __PYX_ERR(1, 4, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("taos._objects.TaosConsumer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":1 - * def __pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_4taos_8_objects_3__pyx_unpickle_TaosCursor(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4taos_8_objects_2__pyx_unpickle_TaosCursor, "__pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state)"); -static PyMethodDef __pyx_mdef_4taos_8_objects_3__pyx_unpickle_TaosCursor = {"__pyx_unpickle_TaosCursor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_3__pyx_unpickle_TaosCursor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_2__pyx_unpickle_TaosCursor}; -static PyObject *__pyx_pw_4taos_8_objects_3__pyx_unpickle_TaosCursor(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v___pyx_type = 0; - long __pyx_v___pyx_checksum; - PyObject *__pyx_v___pyx_state = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_TaosCursor (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - PyObject* values[3] = {0,0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaosCursor", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaosCursor", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_TaosCursor") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_v___pyx_state = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TaosCursor", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("taos._objects.__pyx_unpickle_TaosCursor", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4taos_8_objects_2__pyx_unpickle_TaosCursor(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_4taos_8_objects_2__pyx_unpickle_TaosCursor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = 0; - PyObject *__pyx_v___pyx_result = 0; - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_TraceFrameInit(__pyx_codeobj__61) - __Pyx_RefNannySetupContext("__pyx_unpickle_TaosCursor", 0); - __Pyx_TraceCall("__pyx_unpickle_TaosCursor", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum - */ - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__62, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "(tree fragment)":5 - * cdef object __pyx_result - * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): - * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum - * __pyx_result = TaosCursor.__new__(__pyx_type) - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_PickleError); - __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_1); - __pyx_v___pyx_PickleError = __pyx_t_1; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":6 - * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum # <<<<<<<<<<<<<< - * __pyx_result = TaosCursor.__new__(__pyx_type) - * if __pyx_state is not None: - */ - __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(1, 6, __pyx_L1_error) - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum - */ - } - - /* "(tree fragment)":7 - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum - * __pyx_result = TaosCursor.__new__(__pyx_type) # <<<<<<<<<<<<<< - * if __pyx_state is not None: - * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_v___pyx_result = __pyx_t_1; - __pyx_t_1 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum - * __pyx_result = TaosCursor.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - __pyx_t_2 = (__pyx_v___pyx_state != Py_None); - if (__pyx_t_2) { - - /* "(tree fragment)":9 - * __pyx_result = TaosCursor.__new__(__pyx_type) - * if __pyx_state is not None: - * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< - * return __pyx_result - * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_1 = __pyx_f_4taos_8_objects___pyx_unpickle_TaosCursor__set_state(((struct __pyx_obj_4taos_8_objects_TaosCursor *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum - * __pyx_result = TaosCursor.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - } - - /* "(tree fragment)":10 - * if __pyx_state is not None: - * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) - * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): - * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v___pyx_result); - __pyx_r = __pyx_v___pyx_result; - goto __pyx_L0; - - /* "(tree fragment)":1 - * def __pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("taos._objects.__pyx_unpickle_TaosCursor", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v___pyx_PickleError); - __Pyx_XDECREF(__pyx_v___pyx_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":11 - * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] - * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): - */ - -static PyObject *__pyx_f_4taos_8_objects___pyx_unpickle_TaosCursor__set_state(struct __pyx_obj_4taos_8_objects_TaosCursor *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_TaosCursor__set_state", 0); - __Pyx_TraceCall("__pyx_unpickle_TaosCursor__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); - - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): - * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[3]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4taos_8_objects_TaosConnection))))) __PYX_ERR(1, 12, __pyx_L1_error) - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->_connection); - __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->_connection); - __pyx_v___pyx_result->_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)__pyx_t_1); - __pyx_t_1 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error) - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v___pyx_result->_description); - __Pyx_DECREF(__pyx_v___pyx_result->_description); - __pyx_v___pyx_result->_description = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4taos_8_objects_TaosResult))))) __PYX_ERR(1, 12, __pyx_L1_error) - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->_result); - __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->_result); - __pyx_v___pyx_result->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): - * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] - * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[3]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 13, __pyx_L1_error) - } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_4 = (__pyx_t_3 > 3); - if (__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_2 = __pyx_t_4; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "(tree fragment)":14 - * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] - * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[3]) # <<<<<<<<<<<<<< - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 14, __pyx_L1_error) - } - __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): - * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] - * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[3]) - */ - } - - /* "(tree fragment)":11 - * __pyx_unpickle_TaosCursor__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_TaosCursor__set_state(TaosCursor __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._connection = __pyx_state[0]; __pyx_result._description = __pyx_state[1]; __pyx_result._result = __pyx_state[2] - * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("taos._objects.__pyx_unpickle_TaosCursor__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_TraceReturn(__pyx_r, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_tp_new_4taos_8_objects_TaosConnection(PyTypeObject *t, PyObject *a, PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - #endif - if (unlikely(__pyx_pw_4taos_8_objects_14TaosConnection_1__cinit__(o, a, k) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} - -static void __pyx_tp_dealloc_4taos_8_objects_TaosConnection(PyObject *o) { - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosConnection) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); - __pyx_pw_4taos_8_objects_14TaosConnection_9__dealloc__(o); - __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); - PyErr_Restore(etype, eval, etb); - } - (*Py_TYPE(o)->tp_free)(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_14TaosConnection_client_info(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_14TaosConnection_11client_info_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_14TaosConnection_server_info(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_14TaosConnection_11server_info_1__get__(o); -} - -static PyMethodDef __pyx_methods_4taos_8_objects_TaosConnection[] = { - {"_init_options", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_3_init_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_2_init_options}, - {"_init_conn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_5_init_conn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_4_init_conn}, - {"_check_conn_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_7_check_conn_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_6_check_conn_error}, - {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_11close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_10close}, - {"select_db", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_13select_db, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_12select_db}, - {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_15execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_14execute}, - {"query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_17query, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_16query}, - {"query_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_19query_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_18query_a}, - {"subscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_21subscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_20subscribe}, - {"load_table_info", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_23load_table_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_22load_table_info}, - {"commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_25commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_24commit}, - {"rollback", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_27rollback, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_26rollback}, - {"clear_result_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_29clear_result_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_28clear_result_set}, - {"get_table_vgroup_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_31get_table_vgroup_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_30get_table_vgroup_id}, - {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_32__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_14TaosConnection_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_14TaosConnection_34__setstate_cython__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosConnection[] = { - {(char *)"client_info", __pyx_getprop_4taos_8_objects_14TaosConnection_client_info, 0, (char *)0, 0}, - {(char *)"server_info", __pyx_getprop_4taos_8_objects_14TaosConnection_server_info, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_4taos_8_objects_TaosConnection_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosConnection}, - {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosConnection}, - {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosConnection}, - {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosConnection}, - {0, 0}, -}; -static PyType_Spec __pyx_type_4taos_8_objects_TaosConnection_spec = { - "taos._objects.TaosConnection", - sizeof(struct __pyx_obj_4taos_8_objects_TaosConnection), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, - __pyx_type_4taos_8_objects_TaosConnection_slots, -}; -#else - -static PyTypeObject __pyx_type_4taos_8_objects_TaosConnection = { - PyVarObject_HEAD_INIT(0, 0) - "taos._objects.""TaosConnection", /*tp_name*/ - sizeof(struct __pyx_obj_4taos_8_objects_TaosConnection), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4taos_8_objects_TaosConnection, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4taos_8_objects_TaosConnection, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_4taos_8_objects_TaosConnection, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4taos_8_objects_TaosConnection, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static PyObject *__pyx_tp_new_4taos_8_objects_TaosField(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4taos_8_objects_TaosField *p; - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - #endif - p = ((struct __pyx_obj_4taos_8_objects_TaosField *)o); - p->_name = ((PyObject*)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4taos_8_objects_9TaosField_1__cinit__(o, a, k) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} - -static void __pyx_tp_dealloc_4taos_8_objects_TaosField(PyObject *o) { - struct __pyx_obj_4taos_8_objects_TaosField *p = (struct __pyx_obj_4taos_8_objects_TaosField *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosField) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - Py_CLEAR(p->_name); - (*Py_TYPE(o)->tp_free)(o); -} -static PyObject *__pyx_sq_item_4taos_8_objects_TaosField(PyObject *o, Py_ssize_t i) { - PyObject *r; - PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); - Py_DECREF(x); - return r; -} - -static PyObject *__pyx_getprop_4taos_8_objects_9TaosField_name(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_9TaosField_4name_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_9TaosField_type(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_9TaosField_4type_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_9TaosField_bytes(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_9TaosField_5bytes_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_9TaosField_length(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_9TaosField_6length_1__get__(o); -} - -static PyObject *__pyx_specialmethod___pyx_pw_4taos_8_objects_9TaosField_5__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { - return __pyx_pw_4taos_8_objects_9TaosField_5__repr__(self); -} - -static PyMethodDef __pyx_methods_4taos_8_objects_TaosField[] = { - {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_4taos_8_objects_9TaosField_5__repr__, METH_NOARGS|METH_COEXIST, 0}, - {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_9TaosField_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_9TaosField_8__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_9TaosField_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_9TaosField_10__setstate_cython__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosField[] = { - {(char *)"name", __pyx_getprop_4taos_8_objects_9TaosField_name, 0, (char *)0, 0}, - {(char *)"type", __pyx_getprop_4taos_8_objects_9TaosField_type, 0, (char *)0, 0}, - {(char *)"bytes", __pyx_getprop_4taos_8_objects_9TaosField_bytes, 0, (char *)0, 0}, - {(char *)"length", __pyx_getprop_4taos_8_objects_9TaosField_length, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_4taos_8_objects_TaosField_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosField}, - {Py_tp_repr, (void *)__pyx_pw_4taos_8_objects_9TaosField_5__repr__}, - {Py_sq_item, (void *)__pyx_sq_item_4taos_8_objects_TaosField}, - {Py_mp_subscript, (void *)__pyx_pw_4taos_8_objects_9TaosField_7__getitem__}, - {Py_tp_str, (void *)__pyx_pw_4taos_8_objects_9TaosField_3__str__}, - {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosField}, - {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosField}, - {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosField}, - {0, 0}, -}; -static PyType_Spec __pyx_type_4taos_8_objects_TaosField_spec = { - "taos._objects.TaosField", - sizeof(struct __pyx_obj_4taos_8_objects_TaosField), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, - __pyx_type_4taos_8_objects_TaosField_slots, -}; -#else - -static PySequenceMethods __pyx_tp_as_sequence_TaosField = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_4taos_8_objects_TaosField, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; - -static PyMappingMethods __pyx_tp_as_mapping_TaosField = { - 0, /*mp_length*/ - __pyx_pw_4taos_8_objects_9TaosField_7__getitem__, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyTypeObject __pyx_type_4taos_8_objects_TaosField = { - PyVarObject_HEAD_INIT(0, 0) - "taos._objects.""TaosField", /*tp_name*/ - sizeof(struct __pyx_obj_4taos_8_objects_TaosField), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4taos_8_objects_TaosField, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - __pyx_pw_4taos_8_objects_9TaosField_5__repr__, /*tp_repr*/ - 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_TaosField, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_TaosField, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - __pyx_pw_4taos_8_objects_9TaosField_3__str__, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4taos_8_objects_TaosField, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_4taos_8_objects_TaosField, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4taos_8_objects_TaosField, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static PyObject *__pyx_tp_new_4taos_8_objects_TaosResult(PyTypeObject *t, PyObject *a, PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - #endif - if (unlikely(__pyx_pw_4taos_8_objects_10TaosResult_1__cinit__(o, a, k) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} - -static void __pyx_tp_dealloc_4taos_8_objects_TaosResult(PyObject *o) { - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosResult) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); - __pyx_pw_4taos_8_objects_10TaosResult_29__dealloc__(o); - __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); - PyErr_Restore(etype, eval, etb); - } - (*Py_TYPE(o)->tp_free)(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_fields(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_10TaosResult_6fields_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_field_count(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_10TaosResult_11field_count_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_precision(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_10TaosResult_9precision_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_affected_rows(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_10TaosResult_13affected_rows_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_10TaosResult_row_count(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_10TaosResult_9row_count_1__get__(o); -} - -static PyObject *__pyx_specialmethod___pyx_pw_4taos_8_objects_10TaosResult_5__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { - return __pyx_pw_4taos_8_objects_10TaosResult_5__repr__(self); -} - -static PyMethodDef __pyx_methods_4taos_8_objects_TaosResult[] = { - {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_4taos_8_objects_10TaosResult_5__repr__, METH_NOARGS|METH_COEXIST, 0}, - {"_check_result_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_9_check_result_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_8_check_result_error}, - {"_fetch_block", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_11_fetch_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_10_fetch_block}, - {"fetch_block", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_13fetch_block, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_12fetch_block}, - {"fetch_all", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_15fetch_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_14fetch_all}, - {"fetch_all_into_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_17fetch_all_into_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_16fetch_all_into_dict}, - {"rows_iter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_19rows_iter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_18rows_iter}, - {"blocks_iter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_22blocks_iter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_21blocks_iter}, - {"fetch_rows_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_25fetch_rows_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_24fetch_rows_a}, - {"taos_fetch_raw_block_a", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_26taos_fetch_raw_block_a}, - {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_30__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosResult_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosResult_32__setstate_cython__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosResult[] = { - {(char *)"fields", __pyx_getprop_4taos_8_objects_10TaosResult_fields, 0, (char *)0, 0}, - {(char *)"field_count", __pyx_getprop_4taos_8_objects_10TaosResult_field_count, 0, (char *)0, 0}, - {(char *)"precision", __pyx_getprop_4taos_8_objects_10TaosResult_precision, 0, (char *)0, 0}, - {(char *)"affected_rows", __pyx_getprop_4taos_8_objects_10TaosResult_affected_rows, 0, (char *)0, 0}, - {(char *)"row_count", __pyx_getprop_4taos_8_objects_10TaosResult_row_count, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_4taos_8_objects_TaosResult_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosResult}, - {Py_tp_repr, (void *)__pyx_pw_4taos_8_objects_10TaosResult_5__repr__}, - {Py_tp_str, (void *)__pyx_pw_4taos_8_objects_10TaosResult_3__str__}, - {Py_tp_iter, (void *)__pyx_pw_4taos_8_objects_10TaosResult_7__iter__}, - {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosResult}, - {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosResult}, - {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosResult}, - {0, 0}, -}; -static PyType_Spec __pyx_type_4taos_8_objects_TaosResult_spec = { - "taos._objects.TaosResult", - sizeof(struct __pyx_obj_4taos_8_objects_TaosResult), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, - __pyx_type_4taos_8_objects_TaosResult_slots, -}; -#else - -static PyTypeObject __pyx_type_4taos_8_objects_TaosResult = { - PyVarObject_HEAD_INIT(0, 0) - "taos._objects.""TaosResult", /*tp_name*/ - sizeof(struct __pyx_obj_4taos_8_objects_TaosResult), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4taos_8_objects_TaosResult, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - __pyx_pw_4taos_8_objects_10TaosResult_5__repr__, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - __pyx_pw_4taos_8_objects_10TaosResult_3__str__, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pw_4taos_8_objects_10TaosResult_7__iter__, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4taos_8_objects_TaosResult, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_4taos_8_objects_TaosResult, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4taos_8_objects_TaosResult, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static PyObject *__pyx_tp_new_4taos_8_objects_TaosCursor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_4taos_8_objects_TaosCursor *p; - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - #endif - p = ((struct __pyx_obj_4taos_8_objects_TaosCursor *)o); - p->_description = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)Py_None); Py_INCREF(Py_None); - p->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)Py_None); Py_INCREF(Py_None); - return o; -} - -#if CYTHON_USE_TP_FINALIZE -static void __pyx_tp_finalize_4taos_8_objects_TaosCursor(PyObject *o) { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - __pyx_pw_4taos_8_objects_10TaosCursor_16__del__(o); - PyErr_Restore(etype, eval, etb); -} -#endif - -static void __pyx_tp_dealloc_4taos_8_objects_TaosCursor(PyObject *o) { - struct __pyx_obj_4taos_8_objects_TaosCursor *p = (struct __pyx_obj_4taos_8_objects_TaosCursor *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosCursor) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->_description); - Py_CLEAR(p->_connection); - Py_CLEAR(p->_result); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_4taos_8_objects_TaosCursor(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4taos_8_objects_TaosCursor *p = (struct __pyx_obj_4taos_8_objects_TaosCursor *)o; - if (p->_description) { - e = (*v)(p->_description, a); if (e) return e; - } - if (p->_connection) { - e = (*v)(((PyObject *)p->_connection), a); if (e) return e; - } - if (p->_result) { - e = (*v)(((PyObject *)p->_result), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_4taos_8_objects_TaosCursor(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_4taos_8_objects_TaosCursor *p = (struct __pyx_obj_4taos_8_objects_TaosCursor *)o; - tmp = ((PyObject*)p->_description); - p->_description = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_connection); - p->_connection = ((struct __pyx_obj_4taos_8_objects_TaosConnection *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_result); - p->_result = ((struct __pyx_obj_4taos_8_objects_TaosResult *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_4taos_8_objects_10TaosCursor_description(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_10TaosCursor_11description_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_10TaosCursor_rowcount(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_10TaosCursor_8rowcount_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_10TaosCursor_affected_rows(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_10TaosCursor_13affected_rows_1__get__(o); -} - -static PyMethodDef __pyx_methods_4taos_8_objects_TaosCursor[] = { - {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_6execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_5execute}, - {"fetchone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_8fetchone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_7fetchone}, - {"fetchall", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_10fetchall, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_9fetchall}, - {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_12close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_11close}, - {"_reset_result", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_14_reset_result, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_13_reset_result}, - {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_18__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_17__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_10TaosCursor_20__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_10TaosCursor_19__setstate_cython__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosCursor[] = { - {(char *)"description", __pyx_getprop_4taos_8_objects_10TaosCursor_description, 0, (char *)0, 0}, - {(char *)"rowcount", __pyx_getprop_4taos_8_objects_10TaosCursor_rowcount, 0, (char *)0, 0}, - {(char *)"affected_rows", __pyx_getprop_4taos_8_objects_10TaosCursor_affected_rows, 0, (char *)PyDoc_STR("Return the rowcount of insertion"), 0}, - {0, 0, 0, 0, 0} -}; -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_4taos_8_objects_TaosCursor_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosCursor}, - {Py_tp_doc, (void *)PyDoc_STR("TaosCursor(TaosConnection connection: TaosConnection = None) -> None")}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects_TaosCursor}, - {Py_tp_clear, (void *)__pyx_tp_clear_4taos_8_objects_TaosCursor}, - {Py_tp_iter, (void *)__pyx_pw_4taos_8_objects_10TaosCursor_3__iter__}, - {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosCursor}, - {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosCursor}, - {Py_tp_init, (void *)__pyx_pw_4taos_8_objects_10TaosCursor_1__init__}, - {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosCursor}, - #if PY_VERSION_HEX >= 0x030400a1 - {Py_tp_finalize, (void *)__pyx_tp_finalize_4taos_8_objects_TaosCursor}, - #endif - {0, 0}, -}; -static PyType_Spec __pyx_type_4taos_8_objects_TaosCursor_spec = { - "taos._objects.TaosCursor", - sizeof(struct __pyx_obj_4taos_8_objects_TaosCursor), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_4taos_8_objects_TaosCursor_slots, -}; -#else - -static PyTypeObject __pyx_type_4taos_8_objects_TaosCursor = { - PyVarObject_HEAD_INIT(0, 0) - "taos._objects.""TaosCursor", /*tp_name*/ - sizeof(struct __pyx_obj_4taos_8_objects_TaosCursor), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4taos_8_objects_TaosCursor, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - PyDoc_STR("TaosCursor(TaosConnection connection: TaosConnection = None) -> None"), /*tp_doc*/ - __pyx_tp_traverse_4taos_8_objects_TaosCursor, /*tp_traverse*/ - __pyx_tp_clear_4taos_8_objects_TaosCursor, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - __pyx_pw_4taos_8_objects_10TaosCursor_3__iter__, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4taos_8_objects_TaosCursor, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_4taos_8_objects_TaosCursor, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - __pyx_pw_4taos_8_objects_10TaosCursor_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4taos_8_objects_TaosCursor, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - __pyx_tp_finalize_4taos_8_objects_TaosCursor, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static PyObject *__pyx_tp_new_4taos_8_objects_TaosTopicAssignment(PyTypeObject *t, PyObject *a, PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - #endif - if (unlikely(__pyx_pw_4taos_8_objects_19TaosTopicAssignment_1__cinit__(o, a, k) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} - -static void __pyx_tp_dealloc_4taos_8_objects_TaosTopicAssignment(PyObject *o) { - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosTopicAssignment) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - (*Py_TYPE(o)->tp_free)(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_19TaosTopicAssignment_vg_id(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_19TaosTopicAssignment_5vg_id_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_19TaosTopicAssignment_current_offset(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_19TaosTopicAssignment_14current_offset_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_19TaosTopicAssignment_begin(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_19TaosTopicAssignment_5begin_1__get__(o); -} - -static PyObject *__pyx_getprop_4taos_8_objects_19TaosTopicAssignment_end(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_4taos_8_objects_19TaosTopicAssignment_3end_1__get__(o); -} - -static PyMethodDef __pyx_methods_4taos_8_objects_TaosTopicAssignment[] = { - {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_19TaosTopicAssignment_2__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_19TaosTopicAssignment_4__setstate_cython__}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_4taos_8_objects_TaosTopicAssignment[] = { - {(char *)"vg_id", __pyx_getprop_4taos_8_objects_19TaosTopicAssignment_vg_id, 0, (char *)0, 0}, - {(char *)"current_offset", __pyx_getprop_4taos_8_objects_19TaosTopicAssignment_current_offset, 0, (char *)0, 0}, - {(char *)"begin", __pyx_getprop_4taos_8_objects_19TaosTopicAssignment_begin, 0, (char *)0, 0}, - {(char *)"end", __pyx_getprop_4taos_8_objects_19TaosTopicAssignment_end, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_4taos_8_objects_TaosTopicAssignment_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosTopicAssignment}, - {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosTopicAssignment}, - {Py_tp_getset, (void *)__pyx_getsets_4taos_8_objects_TaosTopicAssignment}, - {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosTopicAssignment}, - {0, 0}, -}; -static PyType_Spec __pyx_type_4taos_8_objects_TaosTopicAssignment_spec = { - "taos._objects.TaosTopicAssignment", - sizeof(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, - __pyx_type_4taos_8_objects_TaosTopicAssignment_slots, -}; -#else - -static PyTypeObject __pyx_type_4taos_8_objects_TaosTopicAssignment = { - PyVarObject_HEAD_INIT(0, 0) - "taos._objects.""TaosTopicAssignment", /*tp_name*/ - sizeof(struct __pyx_obj_4taos_8_objects_TaosTopicAssignment), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4taos_8_objects_TaosTopicAssignment, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4taos_8_objects_TaosTopicAssignment, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_4taos_8_objects_TaosTopicAssignment, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4taos_8_objects_TaosTopicAssignment, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static PyObject *__pyx_tp_new_4taos_8_objects_TaosConsumer(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_4taos_8_objects_TaosConsumer *p; - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - #endif - p = ((struct __pyx_obj_4taos_8_objects_TaosConsumer *)o); - p->_configs = ((PyObject*)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_4taos_8_objects_12TaosConsumer_1__cinit__(o, a, k) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; - return NULL; -} - -static void __pyx_tp_dealloc_4taos_8_objects_TaosConsumer(PyObject *o) { - struct __pyx_obj_4taos_8_objects_TaosConsumer *p = (struct __pyx_obj_4taos_8_objects_TaosConsumer *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects_TaosConsumer) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); - __pyx_pw_4taos_8_objects_12TaosConsumer_31__dealloc__(o); - __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->_configs); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_4taos_8_objects_TaosConsumer(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4taos_8_objects_TaosConsumer *p = (struct __pyx_obj_4taos_8_objects_TaosConsumer *)o; - if (p->_configs) { - e = (*v)(p->_configs, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_4taos_8_objects_TaosConsumer(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_4taos_8_objects_TaosConsumer *p = (struct __pyx_obj_4taos_8_objects_TaosConsumer *)o; - tmp = ((PyObject*)p->_configs); - p->_configs = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_4taos_8_objects_TaosConsumer[] = { - {"subscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_3subscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_2subscribe}, - {"unsubscribe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_5unsubscribe, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_4unsubscribe}, - {"poll", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_7poll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_6poll}, - {"commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_9commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_8commit}, - {"result_commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_11result_commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_10result_commit}, - {"offset_commit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_13offset_commit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_12offset_commit}, - {"get_topic_assignment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_15get_topic_assignment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_14get_topic_assignment}, - {"offset_seek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_17offset_seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_16offset_seek}, - {"position", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_19position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_18position}, - {"committed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_21committed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_20committed}, - {"get_topic_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_23get_topic_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_22get_topic_name}, - {"get_db_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_25get_db_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_24get_db_name}, - {"get_vgroup_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_27get_vgroup_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_26get_vgroup_id}, - {"get_vgroup_offset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_29get_vgroup_offset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_28get_vgroup_offset}, - {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_33__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_32__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4taos_8_objects_12TaosConsumer_35__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4taos_8_objects_12TaosConsumer_34__setstate_cython__}, - {0, 0, 0, 0} -}; -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_4taos_8_objects_TaosConsumer_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects_TaosConsumer}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects_TaosConsumer}, - {Py_tp_clear, (void *)__pyx_tp_clear_4taos_8_objects_TaosConsumer}, - {Py_tp_methods, (void *)__pyx_methods_4taos_8_objects_TaosConsumer}, - {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects_TaosConsumer}, - {0, 0}, -}; -static PyType_Spec __pyx_type_4taos_8_objects_TaosConsumer_spec = { - "taos._objects.TaosConsumer", - sizeof(struct __pyx_obj_4taos_8_objects_TaosConsumer), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, - __pyx_type_4taos_8_objects_TaosConsumer_slots, -}; -#else - -static PyTypeObject __pyx_type_4taos_8_objects_TaosConsumer = { - PyVarObject_HEAD_INIT(0, 0) - "taos._objects.""TaosConsumer", /*tp_name*/ - sizeof(struct __pyx_obj_4taos_8_objects_TaosConsumer), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4taos_8_objects_TaosConsumer, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4taos_8_objects_TaosConsumer, /*tp_traverse*/ - __pyx_tp_clear_4taos_8_objects_TaosConsumer, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_4taos_8_objects_TaosConsumer, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4taos_8_objects_TaosConsumer, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *__pyx_freelist_4taos_8_objects___pyx_scope_struct__rows_iter[8]; -static int __pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter = 0; - -static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter)))) { - o = (PyObject*)__pyx_freelist_4taos_8_objects___pyx_scope_struct__rows_iter[--__pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter]; - memset(o, 0, sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - #endif - return o; -} - -static void __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct__rows_iter(PyObject *o) { - struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct__rows_iter) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_dt_epoch); - Py_CLEAR(p->__pyx_v_is_null); - Py_CLEAR(p->__pyx_v_row); - Py_CLEAR(p->__pyx_v_self); - if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter)))) { - __pyx_freelist_4taos_8_objects___pyx_scope_struct__rows_iter[__pyx_freecount_4taos_8_objects___pyx_scope_struct__rows_iter++] = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct__rows_iter(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter *)o; - if (p->__pyx_v_dt_epoch) { - e = (*v)(p->__pyx_v_dt_epoch, a); if (e) return e; - } - if (p->__pyx_v_is_null) { - e = (*v)(p->__pyx_v_is_null, a); if (e) return e; - } - if (p->__pyx_v_row) { - e = (*v)(p->__pyx_v_row, a); if (e) return e; - } - if (p->__pyx_v_self) { - e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; - } - return 0; -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct__rows_iter}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects___pyx_scope_struct__rows_iter}, - {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter}, - {0, 0}, -}; -static PyType_Spec __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_spec = { - "taos._objects.__pyx_scope_struct__rows_iter", - sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_slots, -}; -#else - -static PyTypeObject __pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter = { - PyVarObject_HEAD_INIT(0, 0) - "taos._objects.""__pyx_scope_struct__rows_iter", /*tp_name*/ - sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct__rows_iter), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct__rows_iter, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct__rows_iter, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4taos_8_objects___pyx_scope_struct__rows_iter, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *__pyx_freelist_4taos_8_objects___pyx_scope_struct_1_blocks_iter[8]; -static int __pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter = 0; - -static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter)))) { - o = (PyObject*)__pyx_freelist_4taos_8_objects___pyx_scope_struct_1_blocks_iter[--__pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter]; - memset(o, 0, sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - #endif - return o; -} - -static void __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_1_blocks_iter(PyObject *o) { - struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_1_blocks_iter) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_block); - Py_CLEAR(p->__pyx_v_num_of_rows); - Py_CLEAR(p->__pyx_8genexpr6__pyx_v_r); - Py_CLEAR(p->__pyx_v_self); - if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter)))) { - __pyx_freelist_4taos_8_objects___pyx_scope_struct_1_blocks_iter[__pyx_freecount_4taos_8_objects___pyx_scope_struct_1_blocks_iter++] = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_1_blocks_iter(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter *)o; - if (p->__pyx_v_block) { - e = (*v)(p->__pyx_v_block, a); if (e) return e; - } - if (p->__pyx_v_num_of_rows) { - e = (*v)(p->__pyx_v_num_of_rows, a); if (e) return e; - } - if (p->__pyx_8genexpr6__pyx_v_r) { - e = (*v)(p->__pyx_8genexpr6__pyx_v_r, a); if (e) return e; - } - if (p->__pyx_v_self) { - e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; - } - return 0; -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_1_blocks_iter}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_1_blocks_iter}, - {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter}, - {0, 0}, -}; -static PyType_Spec __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_spec = { - "taos._objects.__pyx_scope_struct_1_blocks_iter", - sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_slots, -}; -#else - -static PyTypeObject __pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter = { - PyVarObject_HEAD_INIT(0, 0) - "taos._objects.""__pyx_scope_struct_1_blocks_iter", /*tp_name*/ - sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_1_blocks_iter), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_1_blocks_iter, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_1_blocks_iter, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4taos_8_objects___pyx_scope_struct_1_blocks_iter, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *__pyx_freelist_4taos_8_objects___pyx_scope_struct_2___iter__[8]; -static int __pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__ = 0; - -static PyObject *__pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - if (CYTHON_COMPILING_IN_CPYTHON && likely((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__)))) { - o = (PyObject*)__pyx_freelist_4taos_8_objects___pyx_scope_struct_2___iter__[--__pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__]; - memset(o, 0, sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - #endif - return o; -} - -static void __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_2___iter__(PyObject *o) { - struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_2___iter__) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_block); - Py_CLEAR(p->__pyx_v_num_of_rows); - Py_CLEAR(p->__pyx_v_row); - Py_CLEAR(p->__pyx_v_self); - Py_CLEAR(p->__pyx_t_0); - Py_CLEAR(p->__pyx_t_1); - if (CYTHON_COMPILING_IN_CPYTHON && ((int)(__pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__)))) { - __pyx_freelist_4taos_8_objects___pyx_scope_struct_2___iter__[__pyx_freecount_4taos_8_objects___pyx_scope_struct_2___iter__++] = ((struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)o); - } else { - (*Py_TYPE(o)->tp_free)(o); - } -} - -static int __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_2___iter__(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__ *)o; - if (p->__pyx_v_block) { - e = (*v)(p->__pyx_v_block, a); if (e) return e; - } - if (p->__pyx_v_num_of_rows) { - e = (*v)(p->__pyx_v_num_of_rows, a); if (e) return e; - } - if (p->__pyx_v_row) { - e = (*v)(p->__pyx_v_row, a); if (e) return e; - } - if (p->__pyx_v_self) { - e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; - } - if (p->__pyx_t_1) { - e = (*v)(p->__pyx_t_1, a); if (e) return e; - } - return 0; -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_2___iter__}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_2___iter__}, - {Py_tp_new, (void *)__pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__}, - {0, 0}, -}; -static PyType_Spec __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___spec = { - "taos._objects.__pyx_scope_struct_2___iter__", - sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___slots, -}; -#else - -static PyTypeObject __pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__ = { - PyVarObject_HEAD_INIT(0, 0) - "taos._objects.""__pyx_scope_struct_2___iter__", /*tp_name*/ - sizeof(struct __pyx_obj_4taos_8_objects___pyx_scope_struct_2___iter__), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_4taos_8_objects___pyx_scope_struct_2___iter__, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 - 0, /*tp_as_async*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_4taos_8_objects___pyx_scope_struct_2___iter__, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_4taos_8_objects___pyx_scope_struct_2___iter__, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_CONVERT_FUNC, __pyx_k_CONVERT_FUNC, sizeof(__pyx_k_CONVERT_FUNC), 0, 0, 1, 1}, - {&__pyx_n_s_ConnectionError, __pyx_k_ConnectionError, sizeof(__pyx_k_ConnectionError), 0, 0, 1, 1}, - {&__pyx_kp_u_Cursor_is_not_connected, __pyx_k_Cursor_is_not_connected, sizeof(__pyx_k_Cursor_is_not_connected), 0, 1, 0, 0}, - {&__pyx_n_s_DatabaseError, __pyx_k_DatabaseError, sizeof(__pyx_k_DatabaseError), 0, 0, 1, 1}, - {&__pyx_n_u_DictRow, __pyx_k_DictRow, sizeof(__pyx_k_DictRow), 0, 1, 0, 1}, - {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, - {&__pyx_n_s_InternalError, __pyx_k_InternalError, sizeof(__pyx_k_InternalError), 0, 0, 1, 1}, - {&__pyx_kp_u_Invalid_use_of_fetch_iterator, __pyx_k_Invalid_use_of_fetch_iterator, sizeof(__pyx_k_Invalid_use_of_fetch_iterator), 0, 1, 0, 0}, - {&__pyx_kp_u_Invalid_use_of_fetchall, __pyx_k_Invalid_use_of_fetchall, sizeof(__pyx_k_Invalid_use_of_fetchall), 0, 1, 0, 0}, - {&__pyx_kp_u_Invalid_use_of_rows_iter, __pyx_k_Invalid_use_of_rows_iter, sizeof(__pyx_k_Invalid_use_of_rows_iter), 0, 1, 0, 0}, - {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, - {&__pyx_n_s_OperationalError, __pyx_k_OperationalError, sizeof(__pyx_k_OperationalError), 0, 0, 1, 1}, - {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, - {&__pyx_kp_s_Optional_int, __pyx_k_Optional_int, sizeof(__pyx_k_Optional_int), 0, 0, 1, 0}, - {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, - {&__pyx_n_s_ProgrammingError, __pyx_k_ProgrammingError, sizeof(__pyx_k_ProgrammingError), 0, 0, 1, 1}, - {&__pyx_n_s_SIZED_TYPE, __pyx_k_SIZED_TYPE, sizeof(__pyx_k_SIZED_TYPE), 0, 0, 1, 1}, - {&__pyx_n_s_StatementError, __pyx_k_StatementError, sizeof(__pyx_k_StatementError), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection, __pyx_k_TaosConnection, sizeof(__pyx_k_TaosConnection), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection___reduce_cython, __pyx_k_TaosConnection___reduce_cython, sizeof(__pyx_k_TaosConnection___reduce_cython), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection___setstate_cython, __pyx_k_TaosConnection___setstate_cython, sizeof(__pyx_k_TaosConnection___setstate_cython), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection__check_conn_error, __pyx_k_TaosConnection__check_conn_error, sizeof(__pyx_k_TaosConnection__check_conn_error), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection__init_conn, __pyx_k_TaosConnection__init_conn, sizeof(__pyx_k_TaosConnection__init_conn), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection__init_options, __pyx_k_TaosConnection__init_options, sizeof(__pyx_k_TaosConnection__init_options), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_clear_result_set, __pyx_k_TaosConnection_clear_result_set, sizeof(__pyx_k_TaosConnection_clear_result_set), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_close, __pyx_k_TaosConnection_close, sizeof(__pyx_k_TaosConnection_close), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_commit, __pyx_k_TaosConnection_commit, sizeof(__pyx_k_TaosConnection_commit), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_execute, __pyx_k_TaosConnection_execute, sizeof(__pyx_k_TaosConnection_execute), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_get_table_vgroup, __pyx_k_TaosConnection_get_table_vgroup, sizeof(__pyx_k_TaosConnection_get_table_vgroup), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_load_table_info, __pyx_k_TaosConnection_load_table_info, sizeof(__pyx_k_TaosConnection_load_table_info), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_query, __pyx_k_TaosConnection_query, sizeof(__pyx_k_TaosConnection_query), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_query_a, __pyx_k_TaosConnection_query_a, sizeof(__pyx_k_TaosConnection_query_a), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_rollback, __pyx_k_TaosConnection_rollback, sizeof(__pyx_k_TaosConnection_rollback), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_select_db, __pyx_k_TaosConnection_select_db, sizeof(__pyx_k_TaosConnection_select_db), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConnection_subscribe, __pyx_k_TaosConnection_subscribe, sizeof(__pyx_k_TaosConnection_subscribe), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer, __pyx_k_TaosConsumer, sizeof(__pyx_k_TaosConsumer), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer___reduce_cython, __pyx_k_TaosConsumer___reduce_cython, sizeof(__pyx_k_TaosConsumer___reduce_cython), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer___setstate_cython, __pyx_k_TaosConsumer___setstate_cython, sizeof(__pyx_k_TaosConsumer___setstate_cython), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_commit, __pyx_k_TaosConsumer_commit, sizeof(__pyx_k_TaosConsumer_commit), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_committed, __pyx_k_TaosConsumer_committed, sizeof(__pyx_k_TaosConsumer_committed), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_get_db_name, __pyx_k_TaosConsumer_get_db_name, sizeof(__pyx_k_TaosConsumer_get_db_name), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_get_topic_assignmen, __pyx_k_TaosConsumer_get_topic_assignmen, sizeof(__pyx_k_TaosConsumer_get_topic_assignmen), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_get_topic_name, __pyx_k_TaosConsumer_get_topic_name, sizeof(__pyx_k_TaosConsumer_get_topic_name), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_get_vgroup_id, __pyx_k_TaosConsumer_get_vgroup_id, sizeof(__pyx_k_TaosConsumer_get_vgroup_id), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_get_vgroup_offset, __pyx_k_TaosConsumer_get_vgroup_offset, sizeof(__pyx_k_TaosConsumer_get_vgroup_offset), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_offset_commit, __pyx_k_TaosConsumer_offset_commit, sizeof(__pyx_k_TaosConsumer_offset_commit), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_offset_seek, __pyx_k_TaosConsumer_offset_seek, sizeof(__pyx_k_TaosConsumer_offset_seek), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_poll, __pyx_k_TaosConsumer_poll, sizeof(__pyx_k_TaosConsumer_poll), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_position, __pyx_k_TaosConsumer_position, sizeof(__pyx_k_TaosConsumer_position), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_result_commit, __pyx_k_TaosConsumer_result_commit, sizeof(__pyx_k_TaosConsumer_result_commit), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_subscribe, __pyx_k_TaosConsumer_subscribe, sizeof(__pyx_k_TaosConsumer_subscribe), 0, 0, 1, 1}, - {&__pyx_n_s_TaosConsumer_unsubscribe, __pyx_k_TaosConsumer_unsubscribe, sizeof(__pyx_k_TaosConsumer_unsubscribe), 0, 0, 1, 1}, - {&__pyx_n_s_TaosCursor, __pyx_k_TaosCursor, sizeof(__pyx_k_TaosCursor), 0, 0, 1, 1}, - {&__pyx_n_s_TaosCursor___iter, __pyx_k_TaosCursor___iter, sizeof(__pyx_k_TaosCursor___iter), 0, 0, 1, 1}, - {&__pyx_n_s_TaosCursor___reduce_cython, __pyx_k_TaosCursor___reduce_cython, sizeof(__pyx_k_TaosCursor___reduce_cython), 0, 0, 1, 1}, - {&__pyx_n_s_TaosCursor___setstate_cython, __pyx_k_TaosCursor___setstate_cython, sizeof(__pyx_k_TaosCursor___setstate_cython), 0, 0, 1, 1}, - {&__pyx_n_s_TaosCursor__reset_result, __pyx_k_TaosCursor__reset_result, sizeof(__pyx_k_TaosCursor__reset_result), 0, 0, 1, 1}, - {&__pyx_n_s_TaosCursor_close, __pyx_k_TaosCursor_close, sizeof(__pyx_k_TaosCursor_close), 0, 0, 1, 1}, - {&__pyx_n_s_TaosCursor_execute, __pyx_k_TaosCursor_execute, sizeof(__pyx_k_TaosCursor_execute), 0, 0, 1, 1}, - {&__pyx_n_s_TaosCursor_fetchall, __pyx_k_TaosCursor_fetchall, sizeof(__pyx_k_TaosCursor_fetchall), 0, 0, 1, 1}, - {&__pyx_n_s_TaosCursor_fetchone, __pyx_k_TaosCursor_fetchone, sizeof(__pyx_k_TaosCursor_fetchone), 0, 0, 1, 1}, - {&__pyx_n_s_TaosField, __pyx_k_TaosField, sizeof(__pyx_k_TaosField), 0, 0, 1, 1}, - {&__pyx_n_s_TaosField___reduce_cython, __pyx_k_TaosField___reduce_cython, sizeof(__pyx_k_TaosField___reduce_cython), 0, 0, 1, 1}, - {&__pyx_n_s_TaosField___setstate_cython, __pyx_k_TaosField___setstate_cython, sizeof(__pyx_k_TaosField___setstate_cython), 0, 0, 1, 1}, - {&__pyx_kp_u_TaosField_name, __pyx_k_TaosField_name, sizeof(__pyx_k_TaosField_name), 0, 1, 0, 0}, - {&__pyx_n_s_TaosResult, __pyx_k_TaosResult, sizeof(__pyx_k_TaosResult), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult___reduce_cython, __pyx_k_TaosResult___reduce_cython, sizeof(__pyx_k_TaosResult___reduce_cython), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult___setstate_cython, __pyx_k_TaosResult___setstate_cython, sizeof(__pyx_k_TaosResult___setstate_cython), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult__check_result_error, __pyx_k_TaosResult__check_result_error, sizeof(__pyx_k_TaosResult__check_result_error), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult__fetch_block, __pyx_k_TaosResult__fetch_block, sizeof(__pyx_k_TaosResult__fetch_block), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult_blocks_iter, __pyx_k_TaosResult_blocks_iter, sizeof(__pyx_k_TaosResult_blocks_iter), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult_fetch_all, __pyx_k_TaosResult_fetch_all, sizeof(__pyx_k_TaosResult_fetch_all), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult_fetch_all_into_dict, __pyx_k_TaosResult_fetch_all_into_dict, sizeof(__pyx_k_TaosResult_fetch_all_into_dict), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult_fetch_block, __pyx_k_TaosResult_fetch_block, sizeof(__pyx_k_TaosResult_fetch_block), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult_fetch_rows_a, __pyx_k_TaosResult_fetch_rows_a, sizeof(__pyx_k_TaosResult_fetch_rows_a), 0, 0, 1, 1}, - {&__pyx_kp_u_TaosResult_res, __pyx_k_TaosResult_res, sizeof(__pyx_k_TaosResult_res), 0, 1, 0, 0}, - {&__pyx_n_s_TaosResult_rows_iter, __pyx_k_TaosResult_rows_iter, sizeof(__pyx_k_TaosResult_rows_iter), 0, 0, 1, 1}, - {&__pyx_n_s_TaosResult_taos_fetch_raw_block, __pyx_k_TaosResult_taos_fetch_raw_block, sizeof(__pyx_k_TaosResult_taos_fetch_raw_block), 0, 0, 1, 1}, - {&__pyx_n_s_TaosTopicAssignment, __pyx_k_TaosTopicAssignment, sizeof(__pyx_k_TaosTopicAssignment), 0, 0, 1, 1}, - {&__pyx_n_s_TaosTopicAssignment___reduce_cyt, __pyx_k_TaosTopicAssignment___reduce_cyt, sizeof(__pyx_k_TaosTopicAssignment___reduce_cyt), 0, 0, 1, 1}, - {&__pyx_n_s_TaosTopicAssignment___setstate_c, __pyx_k_TaosTopicAssignment___setstate_c, sizeof(__pyx_k_TaosTopicAssignment___setstate_c), 0, 0, 1, 1}, - {&__pyx_n_s_TmqError, __pyx_k_TmqError, sizeof(__pyx_k_TmqError), 0, 0, 1, 1}, - {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_n_s_UNSIZED_TYPE, __pyx_k_UNSIZED_TYPE, sizeof(__pyx_k_UNSIZED_TYPE), 0, 0, 1, 1}, - {&__pyx_n_u_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 1, 0, 1}, - {&__pyx_n_s__101, __pyx_k__101, sizeof(__pyx_k__101), 0, 0, 1, 1}, - {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, - {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, - {&__pyx_kp_u__63, __pyx_k__63, sizeof(__pyx_k__63), 0, 1, 0, 0}, - {&__pyx_n_s__64, __pyx_k__64, sizeof(__pyx_k__64), 0, 0, 1, 1}, - {&__pyx_n_s_affected_rows, __pyx_k_affected_rows, sizeof(__pyx_k_affected_rows), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_asdict, __pyx_k_asdict, sizeof(__pyx_k_asdict), 0, 0, 1, 1}, - {&__pyx_n_s_assignment, __pyx_k_assignment, sizeof(__pyx_k_assignment), 0, 0, 1, 1}, - {&__pyx_n_s_assignment_ptr, __pyx_k_assignment_ptr, sizeof(__pyx_k_assignment_ptr), 0, 0, 1, 1}, - {&__pyx_n_s_astimezone, __pyx_k_astimezone, sizeof(__pyx_k_astimezone), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, - {&__pyx_n_s_begin, __pyx_k_begin, sizeof(__pyx_k_begin), 0, 0, 1, 1}, - {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, - {&__pyx_n_s_blocks, __pyx_k_blocks, sizeof(__pyx_k_blocks), 0, 0, 1, 1}, - {&__pyx_n_s_blocks_iter, __pyx_k_blocks_iter, sizeof(__pyx_k_blocks_iter), 0, 0, 1, 1}, - {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, - {&__pyx_kp_u_bytes_2, __pyx_k_bytes_2, sizeof(__pyx_k_bytes_2), 0, 1, 0, 0}, - {&__pyx_kp_u_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 1, 0, 0}, - {&__pyx_n_s_callback_2, __pyx_k_callback_2, sizeof(__pyx_k_callback_2), 0, 0, 1, 1}, - {&__pyx_n_s_check_conn_error, __pyx_k_check_conn_error, sizeof(__pyx_k_check_conn_error), 0, 0, 1, 1}, - {&__pyx_n_s_check_result_error, __pyx_k_check_result_error, sizeof(__pyx_k_check_result_error), 0, 0, 1, 1}, - {&__pyx_n_s_clear_result_set, __pyx_k_clear_result_set, sizeof(__pyx_k_clear_result_set), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, - {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, - {&__pyx_n_s_commit, __pyx_k_commit, sizeof(__pyx_k_commit), 0, 0, 1, 1}, - {&__pyx_n_s_committed, __pyx_k_committed, sizeof(__pyx_k_committed), 0, 0, 1, 1}, - {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1}, - {&__pyx_n_s_configs, __pyx_k_configs, sizeof(__pyx_k_configs), 0, 0, 1, 1}, - {&__pyx_n_s_connection, __pyx_k_connection, sizeof(__pyx_k_connection), 0, 0, 1, 1}, - {&__pyx_n_s_current_offset, __pyx_k_current_offset, sizeof(__pyx_k_current_offset), 0, 0, 1, 1}, - {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1}, - {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, - {&__pyx_n_s_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 0, 1, 1}, - {&__pyx_n_s_database_2, __pyx_k_database_2, sizeof(__pyx_k_database_2), 0, 0, 1, 1}, - {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, - {&__pyx_n_s_datetime_epoch, __pyx_k_datetime_epoch, sizeof(__pyx_k_datetime_epoch), 0, 0, 1, 1}, - {&__pyx_n_s_db, __pyx_k_db, sizeof(__pyx_k_db), 0, 0, 1, 1}, - {&__pyx_n_s_db_2, __pyx_k_db_2, sizeof(__pyx_k_db_2), 0, 0, 1, 1}, - {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, - {&__pyx_n_s_dict_row_cls, __pyx_k_dict_row_cls, sizeof(__pyx_k_dict_row_cls), 0, 0, 1, 1}, - {&__pyx_kp_s_dict_str_str, __pyx_k_dict_str_str, sizeof(__pyx_k_dict_str_str), 0, 0, 1, 0}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, - {&__pyx_n_s_dt_epoch, __pyx_k_dt_epoch, sizeof(__pyx_k_dt_epoch), 0, 0, 1, 1}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, - {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, - {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, - {&__pyx_n_s_errstr, __pyx_k_errstr, sizeof(__pyx_k_errstr), 0, 0, 1, 1}, - {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1}, - {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, - {&__pyx_n_s_fetch_all, __pyx_k_fetch_all, sizeof(__pyx_k_fetch_all), 0, 0, 1, 1}, - {&__pyx_n_s_fetch_all_into_dict, __pyx_k_fetch_all_into_dict, sizeof(__pyx_k_fetch_all_into_dict), 0, 0, 1, 1}, - {&__pyx_n_s_fetch_block, __pyx_k_fetch_block, sizeof(__pyx_k_fetch_block), 0, 0, 1, 1}, - {&__pyx_n_s_fetch_block_2, __pyx_k_fetch_block_2, sizeof(__pyx_k_fetch_block_2), 0, 0, 1, 1}, - {&__pyx_n_s_fetch_rows_a, __pyx_k_fetch_rows_a, sizeof(__pyx_k_fetch_rows_a), 0, 0, 1, 1}, - {&__pyx_n_s_fetchall, __pyx_k_fetchall, sizeof(__pyx_k_fetchall), 0, 0, 1, 1}, - {&__pyx_n_s_fetchone, __pyx_k_fetchone, sizeof(__pyx_k_fetchone), 0, 0, 1, 1}, - {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, - {&__pyx_n_s_field_names, __pyx_k_field_names, sizeof(__pyx_k_field_names), 0, 0, 1, 1}, - {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1}, - {&__pyx_n_s_fromtimestamp, __pyx_k_fromtimestamp, sizeof(__pyx_k_fromtimestamp), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_get_db_name, __pyx_k_get_db_name, sizeof(__pyx_k_get_db_name), 0, 0, 1, 1}, - {&__pyx_n_s_get_table_vgroup_id, __pyx_k_get_table_vgroup_id, sizeof(__pyx_k_get_table_vgroup_id), 0, 0, 1, 1}, - {&__pyx_n_s_get_topic_assignment, __pyx_k_get_topic_assignment, sizeof(__pyx_k_get_topic_assignment), 0, 0, 1, 1}, - {&__pyx_n_s_get_topic_name, __pyx_k_get_topic_name, sizeof(__pyx_k_get_topic_name), 0, 0, 1, 1}, - {&__pyx_n_s_get_vgroup_id, __pyx_k_get_vgroup_id, sizeof(__pyx_k_get_vgroup_id), 0, 0, 1, 1}, - {&__pyx_n_s_get_vgroup_offset, __pyx_k_get_vgroup_offset, sizeof(__pyx_k_get_vgroup_offset), 0, 0, 1, 1}, - {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, - {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_init_conn, __pyx_k_init_conn, sizeof(__pyx_k_init_conn), 0, 0, 1, 1}, - {&__pyx_n_s_init_options, __pyx_k_init_options, sizeof(__pyx_k_init_options), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_is_null, __pyx_k_is_null, sizeof(__pyx_k_is_null), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, - {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, - {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, - {&__pyx_n_s_k_2, __pyx_k_k_2, sizeof(__pyx_k_k_2), 0, 0, 1, 1}, - {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1}, - {&__pyx_kp_s_list_str, __pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 0, 1, 0}, - {&__pyx_n_s_load_table_info, __pyx_k_load_table_info, sizeof(__pyx_k_load_table_info), 0, 0, 1, 1}, - {&__pyx_n_s_localize, __pyx_k_localize, sizeof(__pyx_k_localize), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, - {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, - {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, - {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, - {&__pyx_n_s_num_of_assignment, __pyx_k_num_of_assignment, sizeof(__pyx_k_num_of_assignment), 0, 0, 1, 1}, - {&__pyx_n_s_num_of_rows, __pyx_k_num_of_rows, sizeof(__pyx_k_num_of_rows), 0, 0, 1, 1}, - {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, - {&__pyx_n_s_offset_commit, __pyx_k_offset_commit, sizeof(__pyx_k_offset_commit), 0, 0, 1, 1}, - {&__pyx_n_s_offset_seek, __pyx_k_offset_seek, sizeof(__pyx_k_offset_seek), 0, 0, 1, 1}, - {&__pyx_n_s_offsets, __pyx_k_offsets, sizeof(__pyx_k_offsets), 0, 0, 1, 1}, - {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, - {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1}, - {&__pyx_n_s_pblock, __pyx_k_pblock, sizeof(__pyx_k_pblock), 0, 0, 1, 1}, - {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, - {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, - {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, - {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1}, - {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1}, - {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, - {&__pyx_n_s_priv_datetime_epoch, __pyx_k_priv_datetime_epoch, sizeof(__pyx_k_priv_datetime_epoch), 0, 0, 1, 1}, - {&__pyx_n_s_priv_tz, __pyx_k_priv_tz, sizeof(__pyx_k_priv_tz), 0, 0, 1, 1}, - {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_unpickle_TaosCursor, __pyx_k_pyx_unpickle_TaosCursor, sizeof(__pyx_k_pyx_unpickle_TaosCursor), 0, 0, 1, 1}, - {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, - {&__pyx_n_s_query_a, __pyx_k_query_a, sizeof(__pyx_k_query_a), 0, 0, 1, 1}, - {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, - {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, - {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, - {&__pyx_n_s_req_id, __pyx_k_req_id, sizeof(__pyx_k_req_id), 0, 0, 1, 1}, - {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, - {&__pyx_n_s_reset_result, __pyx_k_reset_result, sizeof(__pyx_k_reset_result), 0, 0, 1, 1}, - {&__pyx_n_s_result_commit, __pyx_k_result_commit, sizeof(__pyx_k_result_commit), 0, 0, 1, 1}, - {&__pyx_n_s_rollback, __pyx_k_rollback, sizeof(__pyx_k_rollback), 0, 0, 1, 1}, - {&__pyx_n_u_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 1, 0, 1}, - {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1}, - {&__pyx_n_s_row_count, __pyx_k_row_count, sizeof(__pyx_k_row_count), 0, 0, 1, 1}, - {&__pyx_n_s_rows_iter, __pyx_k_rows_iter, sizeof(__pyx_k_rows_iter), 0, 0, 1, 1}, - {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, - {&__pyx_kp_u_select_database_error, __pyx_k_select_database_error, sizeof(__pyx_k_select_database_error), 0, 1, 0, 0}, - {&__pyx_n_s_select_db, __pyx_k_select_db, sizeof(__pyx_k_select_db), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_set_tz, __pyx_k_set_tz, sizeof(__pyx_k_set_tz), 0, 0, 1, 1}, - {&__pyx_kp_u_set_up_tmq_config_failed, __pyx_k_set_up_tmq_config_failed, sizeof(__pyx_k_set_up_tmq_config_failed), 0, 1, 0, 0}, - {&__pyx_kp_u_set_up_tmq_list_failed, __pyx_k_set_up_tmq_list_failed, sizeof(__pyx_k_set_up_tmq_list_failed), 0, 1, 0, 0}, - {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, - {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, - {&__pyx_kp_u_setup_tmq_failed, __pyx_k_setup_tmq_failed, sizeof(__pyx_k_setup_tmq_failed), 0, 1, 0, 0}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_sql, __pyx_k_sql, sizeof(__pyx_k_sql), 0, 0, 1, 1}, - {&__pyx_n_s_sql_2, __pyx_k_sql_2, sizeof(__pyx_k_sql_2), 0, 0, 1, 1}, - {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, - {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, - {&__pyx_n_s_subscribe, __pyx_k_subscribe, sizeof(__pyx_k_subscribe), 0, 0, 1, 1}, - {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1}, - {&__pyx_n_s_table_2, __pyx_k_table_2, sizeof(__pyx_k_table_2), 0, 0, 1, 1}, - {&__pyx_n_s_tables, __pyx_k_tables, sizeof(__pyx_k_tables), 0, 0, 1, 1}, - {&__pyx_n_s_tables_2, __pyx_k_tables_2, sizeof(__pyx_k_tables_2), 0, 0, 1, 1}, - {&__pyx_n_s_taos__cinterface, __pyx_k_taos__cinterface, sizeof(__pyx_k_taos__cinterface), 0, 0, 1, 1}, - {&__pyx_n_s_taos__objects, __pyx_k_taos__objects, sizeof(__pyx_k_taos__objects), 0, 0, 1, 1}, - {&__pyx_kp_s_taos__objects_pyx, __pyx_k_taos__objects_pyx, sizeof(__pyx_k_taos__objects_pyx), 0, 0, 1, 0}, - {&__pyx_n_s_taos_error, __pyx_k_taos_error, sizeof(__pyx_k_taos_error), 0, 0, 1, 1}, - {&__pyx_n_s_taos_fetch_raw_block_a, __pyx_k_taos_fetch_raw_block_a, sizeof(__pyx_k_taos_fetch_raw_block_a), 0, 0, 1, 1}, - {&__pyx_n_s_taos_res, __pyx_k_taos_res, sizeof(__pyx_k_taos_res), 0, 0, 1, 1}, - {&__pyx_n_s_taos_row, __pyx_k_taos_row, sizeof(__pyx_k_taos_row), 0, 0, 1, 1}, - {&__pyx_n_u_taosdata, __pyx_k_taosdata, sizeof(__pyx_k_taosdata), 0, 1, 0, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, - {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, - {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1}, - {&__pyx_n_s_tmq_conf, __pyx_k_tmq_conf, sizeof(__pyx_k_tmq_conf), 0, 0, 1, 1}, - {&__pyx_kp_u_tmq_conf_res, __pyx_k_tmq_conf_res, sizeof(__pyx_k_tmq_conf_res), 0, 1, 0, 0}, - {&__pyx_n_s_tmq_conf_res_2, __pyx_k_tmq_conf_res_2, sizeof(__pyx_k_tmq_conf_res_2), 0, 0, 1, 1}, - {&__pyx_n_s_tmq_errno, __pyx_k_tmq_errno, sizeof(__pyx_k_tmq_errno), 0, 0, 1, 1}, - {&__pyx_n_s_tmq_list, __pyx_k_tmq_list, sizeof(__pyx_k_tmq_list), 0, 0, 1, 1}, - {&__pyx_n_s_topic, __pyx_k_topic, sizeof(__pyx_k_topic), 0, 0, 1, 1}, - {&__pyx_n_s_topic_2, __pyx_k_topic_2, sizeof(__pyx_k_topic_2), 0, 0, 1, 1}, - {&__pyx_n_s_topic_assignments, __pyx_k_topic_assignments, sizeof(__pyx_k_topic_assignments), 0, 0, 1, 1}, - {&__pyx_n_s_topics, __pyx_k_topics, sizeof(__pyx_k_topics), 0, 0, 1, 1}, - {&__pyx_n_s_tp, __pyx_k_tp, sizeof(__pyx_k_tp), 0, 0, 1, 1}, - {&__pyx_n_s_tp_2, __pyx_k_tp_2, sizeof(__pyx_k_tp_2), 0, 0, 1, 1}, - {&__pyx_n_s_tta, __pyx_k_tta, sizeof(__pyx_k_tta), 0, 0, 1, 1}, - {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, - {&__pyx_kp_u_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 1, 0, 0}, - {&__pyx_n_s_type_3, __pyx_k_type_3, sizeof(__pyx_k_type_3), 0, 0, 1, 1}, - {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, - {&__pyx_n_s_tz, __pyx_k_tz, sizeof(__pyx_k_tz), 0, 0, 1, 1}, - {&__pyx_n_s_unsubscribe, __pyx_k_unsubscribe, sizeof(__pyx_k_unsubscribe), 0, 0, 1, 1}, - {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, - {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, - {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, - {&__pyx_n_s_utc_datetime_epoch, __pyx_k_utc_datetime_epoch, sizeof(__pyx_k_utc_datetime_epoch), 0, 0, 1, 1}, - {&__pyx_n_s_utc_tz, __pyx_k_utc_tz, sizeof(__pyx_k_utc_tz), 0, 0, 1, 1}, - {&__pyx_n_s_utcfromtimestamp, __pyx_k_utcfromtimestamp, sizeof(__pyx_k_utcfromtimestamp), 0, 0, 1, 1}, - {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, - {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, - {&__pyx_n_s_v_2, __pyx_k_v_2, sizeof(__pyx_k_v_2), 0, 0, 1, 1}, - {&__pyx_n_s_vg_id, __pyx_k_vg_id, sizeof(__pyx_k_vg_id), 0, 0, 1, 1}, - {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 16, __pyx_L1_error) - __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 31, __pyx_L1_error) - __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 42, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 42, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 292, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "taos/_objects.pyx":519 - * tmq_conf_destroy(self._tmq_conf) - * self._tmq_conf = NULL - * raise Exception("set up tmq config failed!") # <<<<<<<<<<<<<< - * - * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) - */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_set_up_tmq_config_failed); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - - /* "taos/_objects.pyx":523 - * self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) - * if self._tmq is NULL: - * raise Exception("setup tmq failed") # <<<<<<<<<<<<<< - * - * def subscribe(self, topics: list[str]): - */ - __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_setup_tmq_failed); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - - /* "taos/_objects.pyx":528 - * tmq_list = tmq_list_new() - * if tmq_list is NULL: - * raise Exception("set up tmq list failed!") # <<<<<<<<<<<<<< - * - * for tp in topics: - */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_set_up_tmq_list_failed); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum not in (0x78b1cdf, 0x104af6a, 0xbe606a1): # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x78b1cdf, 0x104af6a, 0xbe606a1) = (_connection, _description, _result))" % __pyx_checksum - */ - __pyx_tuple__62 = PyTuple_Pack(3, __pyx_int_126557407, __pyx_int_17084266, __pyx_int_199624353); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); - - /* "taos/_objects.pyx":13 - * - * _priv_tz = None - * _utc_tz = pytz.timezone("UTC") # <<<<<<<<<<<<<< - * try: - * _datetime_epoch = dt.datetime.fromtimestamp(0) - */ - __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_u_UTC); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); - - /* "taos/_objects.pyx":15 - * _utc_tz = pytz.timezone("UTC") - * try: - * _datetime_epoch = dt.datetime.fromtimestamp(0) # <<<<<<<<<<<<<< - * except OSError: - * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) - */ - __pyx_tuple__66 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); - - /* "taos/_objects.pyx":17 - * _datetime_epoch = dt.datetime.fromtimestamp(0) - * except OSError: - * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) # <<<<<<<<<<<<<< - * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) - * _priv_datetime_epoch = None - */ - __pyx_tuple__67 = PyTuple_Pack(1, __pyx_int_86400); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); - - /* "taos/_objects.pyx":22 - * - * - * def set_tz(tz): # <<<<<<<<<<<<<< - * global _priv_tz, _priv_datetime_epoch - * _priv_tz = tz - */ - __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); - __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_set_tz, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 22, __pyx_L1_error) - - /* "taos/_objects.pyx":88 - * self._check_conn_error() - * - * def _init_options(self): # <<<<<<<<<<<<<< - * if self._tz: - * tz = self._tz - */ - __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tz); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_init_options, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 88, __pyx_L1_error) - - /* "taos/_objects.pyx":97 - * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) - * - * def _init_conn(self): # <<<<<<<<<<<<<< - * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - * - */ - __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_init_conn, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 97, __pyx_L1_error) - - /* "taos/_objects.pyx":100 - * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - * - * def _check_conn_error(self): # <<<<<<<<<<<<<< - * errno = taos_errno(self._raw_conn) - * if errno != 0: - */ - __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_errno, __pyx_n_s_errstr); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_check_conn_error, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 100, __pyx_L1_error) - - /* "taos/_objects.pyx":109 - * self.close() - * - * def close(self): # <<<<<<<<<<<<<< - * if self._raw_conn is not NULL: - * taos_close(self._raw_conn) - */ - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_close, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 109, __pyx_L1_error) - - /* "taos/_objects.pyx":125 - * return taos_get_server_info(self._raw_conn).decode("utf-8") - * - * def select_db(self, database: str): # <<<<<<<<<<<<<< - * _database = database.encode("utf-8") - * res = taos_select_db(self._raw_conn, _database) - */ - __pyx_tuple__72 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_database, __pyx_n_s_database_2, __pyx_n_s_res); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__72); - __Pyx_GIVEREF(__pyx_tuple__72); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_select_db, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 125, __pyx_L1_error) - - /* "taos/_objects.pyx":131 - * raise DatabaseError("select database error", res) - * - * def execute(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * return self.query(sql, req_id).affected_rows - * - */ - __pyx_tuple__73 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sql, __pyx_n_s_req_id); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__73); - __Pyx_GIVEREF(__pyx_tuple__73); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_execute, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 131, __pyx_L1_error) - __pyx_tuple__74 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); - - /* "taos/_objects.pyx":134 - * return self.query(sql, req_id).affected_rows - * - * def query(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * _sql = sql.encode("utf-8") - * if req_id is None: - */ - __pyx_tuple__75 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sql, __pyx_n_s_req_id, __pyx_n_s_sql_2, __pyx_n_s_res); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__75); - __Pyx_GIVEREF(__pyx_tuple__75); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_query, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 134, __pyx_L1_error) - - /* "taos/_objects.pyx":143 - * return TaosResult(res) - * - * def query_a(self, sql: str, callback, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * _sql = sql.encode("utf-8") - * if req_id is None: - */ - __pyx_tuple__76 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sql, __pyx_n_s_callback_2, __pyx_n_s_req_id, __pyx_n_s_sql_2); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__76); - __Pyx_GIVEREF(__pyx_tuple__76); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_query_a, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 143, __pyx_L1_error) - - /* "taos/_objects.pyx":150 - * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) - * - * def subscribe(self, configs: dict[str, str], callback): # <<<<<<<<<<<<<< - * if self._raw_conn is NULL: - * return None - */ - __pyx_tuple__77 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_configs, __pyx_n_s_callback_2, __pyx_n_s_tmq_conf, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_k_2, __pyx_n_s_v_2, __pyx_n_s_tmq_conf_res_2); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__77); - __Pyx_GIVEREF(__pyx_tuple__77); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_subscribe, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 150, __pyx_L1_error) - - /* "taos/_objects.pyx":161 - * print("tmq_conf_res:", tmq_conf_res) - * - * def load_table_info(self, tables: list): # <<<<<<<<<<<<<< - * # type: (str) -> None - * _tables = ",".join(tables).encode("utf-8") - */ - __pyx_tuple__78 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tables, __pyx_n_s_tables_2); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__78); - __Pyx_GIVEREF(__pyx_tuple__78); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_load_table_info, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 161, __pyx_L1_error) - - /* "taos/_objects.pyx":166 - * taos_load_table_info(self._raw_conn, _tables) - * - * def commit(self): # <<<<<<<<<<<<<< - * """Commit any pending transaction to the database. - * - */ - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_commit, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 166, __pyx_L1_error) - - /* "taos/_objects.pyx":173 - * pass - * - * def rollback(self): # <<<<<<<<<<<<<< - * """Void functionality""" - * pass - */ - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_rollback, 173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 173, __pyx_L1_error) - - /* "taos/_objects.pyx":177 - * pass - * - * def clear_result_set(self): # <<<<<<<<<<<<<< - * """Clear unused result set on this connection.""" - * pass - */ - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_clear_result_set, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 177, __pyx_L1_error) - - /* "taos/_objects.pyx":181 - * pass - * - * def get_table_vgroup_id(self, db: str, table: str): # <<<<<<<<<<<<<< - * # type: (str, str) -> int - * """ - */ - __pyx_tuple__79 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_db, __pyx_n_s_table, __pyx_n_s_vg_id, __pyx_n_s_db_2, __pyx_n_s_table_2, __pyx_n_s_code); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__79); - __Pyx_GIVEREF(__pyx_tuple__79); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_table_vgroup_id, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 181, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 1, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_tuple__80 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__80); - __Pyx_GIVEREF(__pyx_tuple__80); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 3, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 1, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 3, __pyx_L1_error) - - /* "taos/_objects.pyx":277 - * return self._row_count - * - * def _check_result_error(self): # <<<<<<<<<<<<<< - * errno = taos_errno(self._res) - * if errno != 0: - */ - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_check_result_error, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 277, __pyx_L1_error) - - /* "taos/_objects.pyx":283 - * raise ProgrammingError(errstr, errno) - * - * def _fetch_block(self): # <<<<<<<<<<<<<< - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(self._res, &pblock) - */ - __pyx_tuple__81 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_pblock, __pyx_n_s_num_of_rows, __pyx_n_s_blocks, __pyx_n_s_dt_epoch, __pyx_n_s_i, __pyx_n_s_data, __pyx_n_s_field, __pyx_n_s_offsets, __pyx_n_s_is_null); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__81); - __Pyx_GIVEREF(__pyx_tuple__81); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_block, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 283, __pyx_L1_error) - - /* "taos/_objects.pyx":310 - * return blocks, abs(num_of_rows) - * - * def fetch_block(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetch iterator") - */ - __pyx_tuple__82 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_num_of_rows, __pyx_n_s_r); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__82); - __Pyx_GIVEREF(__pyx_tuple__82); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_block_2, 310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 310, __pyx_L1_error) - - /* "taos/_objects.pyx":319 - * return [r for r in map(tuple, zip(*block))], num_of_rows - * - * def fetch_all(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") - */ - __pyx_tuple__83 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_blocks, __pyx_n_s_block, __pyx_n_s_num_of_rows, __pyx_n_s_b, __pyx_n_s_r); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__83); - __Pyx_GIVEREF(__pyx_tuple__83); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_all, 319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 319, __pyx_L1_error) - - /* "taos/_objects.pyx":336 - * return [r for b in blocks for r in map(tuple, zip(*b))] - * - * def fetch_all_into_dict(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") - */ - __pyx_tuple__84 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_field_names, __pyx_n_s_dict_row_cls, __pyx_n_s_blocks, __pyx_n_s_block, __pyx_n_s_num_of_rows, __pyx_n_s_field, __pyx_n_s_b, __pyx_n_s_r); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__84); - __Pyx_GIVEREF(__pyx_tuple__84); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_all_into_dict, 336, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 336, __pyx_L1_error) - - /* "taos/_objects.pyx":355 - * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] - * - * def rows_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ - __pyx_tuple__85 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_taos_row, __pyx_n_s_i, __pyx_n_s_dt_epoch, __pyx_n_s_is_null, __pyx_n_s_row, __pyx_n_s_data, __pyx_n_s_field); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__85); - __Pyx_GIVEREF(__pyx_tuple__85); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_rows_iter, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 355, __pyx_L1_error) - - /* "taos/_objects.pyx":387 - * yield row - * - * def blocks_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_blocks_iter, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 387, __pyx_L1_error) - - /* "taos/_objects.pyx":399 - * yield [r for r in map(tuple, zip(*block))], num_of_rows - * - * def fetch_rows_a(self, callback): # <<<<<<<<<<<<<< - * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) - * - */ - __pyx_tuple__86 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback_2); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__86); - __Pyx_GIVEREF(__pyx_tuple__86); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetch_rows_a, 399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 399, __pyx_L1_error) - - /* "taos/_objects.pyx":402 - * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) - * - * def taos_fetch_raw_block_a(self, callback): # <<<<<<<<<<<<<< - * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) - * - */ - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_taos_fetch_raw_block_a, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 402, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 1, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 3, __pyx_L1_error) - - /* "taos/_objects.pyx":441 - * return self._result.affected_rows - * - * def execute(self, sql, params=None, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * """Prepare and execute a database operation (query or command).""" - * if not self._connection: - */ - __pyx_tuple__87 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_sql, __pyx_n_s_params, __pyx_n_s_req_id, __pyx_n_s_f); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_execute, 441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 441, __pyx_L1_error) - __pyx_tuple__88 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__88); - __Pyx_GIVEREF(__pyx_tuple__88); - - /* "taos/_objects.pyx":451 - * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] - * - * def fetchone(self): # <<<<<<<<<<<<<< - * return next(self) - * - */ - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetchone, 451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 451, __pyx_L1_error) - - /* "taos/_objects.pyx":454 - * return next(self) - * - * def fetchall(self): # <<<<<<<<<<<<<< - * return [r for r in self] - * - */ - __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__89); - __Pyx_GIVEREF(__pyx_tuple__89); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_fetchall, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 454, __pyx_L1_error) - - /* "taos/_objects.pyx":457 - * return [r for r in self] - * - * def close(self): # <<<<<<<<<<<<<< - * if self._connection is None: - * return False - */ - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_close, 457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 457, __pyx_L1_error) - - /* "taos/_objects.pyx":466 - * return True - * - * def _reset_result(self): # <<<<<<<<<<<<<< - * """Reset the result to unused version.""" - * self._description = [] - */ - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_reset_result, 466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 466, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict - */ - __pyx_tuple__90 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__90); - __Pyx_GIVEREF(__pyx_tuple__90); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 1, __pyx_L1_error) - - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) - */ - __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 16, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 1, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 3, __pyx_L1_error) - - /* "taos/_objects.pyx":525 - * raise Exception("setup tmq failed") - * - * def subscribe(self, topics: list[str]): # <<<<<<<<<<<<<< - * tmq_list = tmq_list_new() - * if tmq_list is NULL: - */ - __pyx_tuple__91 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_topics, __pyx_n_s_tmq_list, __pyx_n_s_tp, __pyx_n_s_tp_2, __pyx_n_s_tmq_errno); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__91); - __Pyx_GIVEREF(__pyx_tuple__91); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_subscribe, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 525, __pyx_L1_error) - - /* "taos/_objects.pyx":542 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def unsubscribe(self): # <<<<<<<<<<<<<< - * tmq_errno = tmq_unsubscribe(self._tmq) - * if tmq_errno != 0: - */ - __pyx_tuple__92 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tmq_errno); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__92); - __Pyx_GIVEREF(__pyx_tuple__92); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_unsubscribe, 542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 542, __pyx_L1_error) - - /* "taos/_objects.pyx":547 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def poll(self, timeout: int): # <<<<<<<<<<<<<< - * res = tmq_consumer_poll(self._tmq, timeout) - * if res is NULL: - */ - __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_timeout, __pyx_n_s_res); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__93); - __Pyx_GIVEREF(__pyx_tuple__93); - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_poll, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 547, __pyx_L1_error) - - /* "taos/_objects.pyx":554 - * return TaosResult(res) - * - * def commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * self.result_commit(taos_res) - * - */ - __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_taos_res); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__94); - __Pyx_GIVEREF(__pyx_tuple__94); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_commit, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 554, __pyx_L1_error) - - /* "taos/_objects.pyx":557 - * self.result_commit(taos_res) - * - * def result_commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) - * if tmq_errno != 0: - */ - __pyx_tuple__95 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_taos_res, __pyx_n_s_tmq_errno); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__95); - __Pyx_GIVEREF(__pyx_tuple__95); - __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_result_commit, 557, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 557, __pyx_L1_error) - - /* "taos/_objects.pyx":562 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def offset_commit(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) - */ - __pyx_tuple__96 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_topic, __pyx_n_s_vg_id, __pyx_n_s_offset, __pyx_n_s_topic_2, __pyx_n_s_tmq_errno); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__96); - __Pyx_GIVEREF(__pyx_tuple__96); - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_offset_commit, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 562, __pyx_L1_error) - - /* "taos/_objects.pyx":568 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def get_topic_assignment(self, topic: str): # <<<<<<<<<<<<<< - * cdef int32_t num_of_assignment - * cdef tmq_topic_assignment *assignment_ptr = NULL - */ - __pyx_tuple__97 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_topic, __pyx_n_s_num_of_assignment, __pyx_n_s_assignment_ptr, __pyx_n_s_topic_2, __pyx_n_s_tmq_errno, __pyx_n_s_assignment, __pyx_n_s_topic_assignments, __pyx_n_s_i, __pyx_n_s_tta); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__97); - __Pyx_GIVEREF(__pyx_tuple__97); - __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_topic_assignment, 568, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 568, __pyx_L1_error) - - /* "taos/_objects.pyx":588 - * return topic_assignments - * - * def offset_seek(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) - */ - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_offset_seek, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 588, __pyx_L1_error) - - /* "taos/_objects.pyx":594 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def position(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * pos = tmq_position(self._tmq, _topic, vg_id) - */ - __pyx_tuple__98 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_topic, __pyx_n_s_vg_id, __pyx_n_s_topic_2, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__98); - __Pyx_GIVEREF(__pyx_tuple__98); - __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_position, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 594, __pyx_L1_error) - - /* "taos/_objects.pyx":602 - * return pos - * - * def committed(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * offset = tmq_committed(self._tmq, _topic, vg_id) - */ - __pyx_tuple__99 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_topic, __pyx_n_s_vg_id, __pyx_n_s_topic_2, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__99); - __Pyx_GIVEREF(__pyx_tuple__99); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_committed, 602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 602, __pyx_L1_error) - - /* "taos/_objects.pyx":613 - * return offset - * - * def get_topic_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_topic_name(taos_res._res) - * - */ - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_topic_name, 613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 613, __pyx_L1_error) - - /* "taos/_objects.pyx":616 - * return tmq_get_topic_name(taos_res._res) - * - * def get_db_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_db_name(taos_res._res) - * - */ - __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_db_name, 616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 616, __pyx_L1_error) - - /* "taos/_objects.pyx":619 - * return tmq_get_db_name(taos_res._res) - * - * def get_vgroup_id(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_vgroup_id(taos_res._res) - * - */ - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_vgroup_id, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 619, __pyx_L1_error) - - /* "taos/_objects.pyx":622 - * return tmq_get_vgroup_id(taos_res._res) - * - * def get_vgroup_offset(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_vgroup_offset(taos_res._res) - * - */ - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_taos__objects_pyx, __pyx_n_s_get_vgroup_offset, 622, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 622, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(1, 1, __pyx_L1_error) - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 3, __pyx_L1_error) - - /* "(tree fragment)":1 - * def __pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result - */ - __pyx_tuple__100 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__100); - __Pyx_GIVEREF(__pyx_tuple__100); - __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TaosCursor, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_86400 = PyInt_FromLong(86400L); if (unlikely(!__pyx_int_86400)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_17084266 = PyInt_FromLong(17084266L); if (unlikely(!__pyx_int_17084266)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_126557407 = PyInt_FromLong(126557407L); if (unlikely(!__pyx_int_126557407)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_199624353 = PyInt_FromLong(199624353L); if (unlikely(!__pyx_int_199624353)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(void) { - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_4taos_8_objects_TaosConnection = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosConnection_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosConnection)) __PYX_ERR(0, 46, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosConnection_spec, __pyx_ptype_4taos_8_objects_TaosConnection) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - #else - __pyx_ptype_4taos_8_objects_TaosConnection = &__pyx_type_4taos_8_objects_TaosConnection; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosConnection) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_4taos_8_objects_TaosConnection->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosConnection->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosConnection->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_4taos_8_objects_TaosConnection->tp_getattro = __Pyx_PyObject_GenericGetAttr; - } - #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosConnection, (PyObject *) __pyx_ptype_4taos_8_objects_TaosConnection) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosConnection) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_4taos_8_objects_TaosField = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosField_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosField)) __PYX_ERR(0, 195, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosField_spec, __pyx_ptype_4taos_8_objects_TaosField) < 0) __PYX_ERR(0, 195, __pyx_L1_error) - #else - __pyx_ptype_4taos_8_objects_TaosField = &__pyx_type_4taos_8_objects_TaosField; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosField) < 0) __PYX_ERR(0, 195, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_4taos_8_objects_TaosField->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosField->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosField->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_4taos_8_objects_TaosField->tp_getattro = __Pyx_PyObject_GenericGetAttr; - } - #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosField, (PyObject *) __pyx_ptype_4taos_8_objects_TaosField) < 0) __PYX_ERR(0, 195, __pyx_L1_error) - #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosField) < 0) __PYX_ERR(0, 195, __pyx_L1_error) - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_4taos_8_objects_TaosResult = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosResult_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosResult)) __PYX_ERR(0, 231, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosResult_spec, __pyx_ptype_4taos_8_objects_TaosResult) < 0) __PYX_ERR(0, 231, __pyx_L1_error) - #else - __pyx_ptype_4taos_8_objects_TaosResult = &__pyx_type_4taos_8_objects_TaosResult; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosResult) < 0) __PYX_ERR(0, 231, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_4taos_8_objects_TaosResult->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosResult->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosResult->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_4taos_8_objects_TaosResult->tp_getattro = __Pyx_PyObject_GenericGetAttr; - } - #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosResult, (PyObject *) __pyx_ptype_4taos_8_objects_TaosResult) < 0) __PYX_ERR(0, 231, __pyx_L1_error) - #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosResult) < 0) __PYX_ERR(0, 231, __pyx_L1_error) - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_4taos_8_objects_TaosCursor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosCursor_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosCursor)) __PYX_ERR(0, 413, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosCursor_spec, __pyx_ptype_4taos_8_objects_TaosCursor) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - #else - __pyx_ptype_4taos_8_objects_TaosCursor = &__pyx_type_4taos_8_objects_TaosCursor; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosCursor) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_4taos_8_objects_TaosCursor->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosCursor->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosCursor->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_4taos_8_objects_TaosCursor->tp_getattro = __Pyx_PyObject_GenericGetAttr; - } - #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosCursor, (PyObject *) __pyx_ptype_4taos_8_objects_TaosCursor) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosCursor) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_4taos_8_objects_TaosTopicAssignment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosTopicAssignment_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosTopicAssignment)) __PYX_ERR(0, 475, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosTopicAssignment_spec, __pyx_ptype_4taos_8_objects_TaosTopicAssignment) < 0) __PYX_ERR(0, 475, __pyx_L1_error) - #else - __pyx_ptype_4taos_8_objects_TaosTopicAssignment = &__pyx_type_4taos_8_objects_TaosTopicAssignment; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosTopicAssignment) < 0) __PYX_ERR(0, 475, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_4taos_8_objects_TaosTopicAssignment->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosTopicAssignment->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosTopicAssignment->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_4taos_8_objects_TaosTopicAssignment->tp_getattro = __Pyx_PyObject_GenericGetAttr; - } - #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosTopicAssignment, (PyObject *) __pyx_ptype_4taos_8_objects_TaosTopicAssignment) < 0) __PYX_ERR(0, 475, __pyx_L1_error) - #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosTopicAssignment) < 0) __PYX_ERR(0, 475, __pyx_L1_error) - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_4taos_8_objects_TaosConsumer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects_TaosConsumer_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects_TaosConsumer)) __PYX_ERR(0, 504, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects_TaosConsumer_spec, __pyx_ptype_4taos_8_objects_TaosConsumer) < 0) __PYX_ERR(0, 504, __pyx_L1_error) - #else - __pyx_ptype_4taos_8_objects_TaosConsumer = &__pyx_type_4taos_8_objects_TaosConsumer; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects_TaosConsumer) < 0) __PYX_ERR(0, 504, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_4taos_8_objects_TaosConsumer->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dictoffset && __pyx_ptype_4taos_8_objects_TaosConsumer->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_4taos_8_objects_TaosConsumer->tp_getattro = __Pyx_PyObject_GenericGetAttr; - } - #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TaosConsumer, (PyObject *) __pyx_ptype_4taos_8_objects_TaosConsumer) < 0) __PYX_ERR(0, 504, __pyx_L1_error) - #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4taos_8_objects_TaosConsumer) < 0) __PYX_ERR(0, 504, __pyx_L1_error) - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter)) __PYX_ERR(0, 355, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter_spec, __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter) < 0) __PYX_ERR(0, 355, __pyx_L1_error) - #else - __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter = &__pyx_type_4taos_8_objects___pyx_scope_struct__rows_iter; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter) < 0) __PYX_ERR(0, 355, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter->tp_dictoffset && __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_4taos_8_objects___pyx_scope_struct__rows_iter->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - } - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter)) __PYX_ERR(0, 387, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter_spec, __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - #else - __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter = &__pyx_type_4taos_8_objects___pyx_scope_struct_1_blocks_iter; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter->tp_dictoffset && __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_4taos_8_objects___pyx_scope_struct_1_blocks_iter->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - } - #endif - #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___spec, NULL); if (unlikely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__)) __PYX_ERR(0, 423, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter___spec, __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(0, 423, __pyx_L1_error) - #else - __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__ = &__pyx_type_4taos_8_objects___pyx_scope_struct_2___iter__; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(0, 423, __pyx_L1_error) - #endif - #if PY_MAJOR_VERSION < 3 - __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__->tp_print = 0; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__->tp_dictoffset && __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_4taos_8_objects___pyx_scope_struct_2___iter__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - } - #endif - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_type_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_import_code(void) { - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __pyx_t_1 = PyImport_ImportModule("taos._cinterface"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "taos_get_column_data_is_null", (void (**)(void))&__pyx_f_4taos_11_cinterface_taos_get_column_data_is_null, "PyObject *(TAOS_RES *, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "taos_fetch_block_v3", (void (**)(void))&__pyx_f_4taos_11_cinterface_taos_fetch_block_v3, "PyObject *(TAOS_RES *, TAOS_FIELD *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("taos._parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_binary_string", (void (**)(void))&__pyx_f_4taos_7_parser__parse_binary_string, "PyObject *(size_t, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_nchar_string", (void (**)(void))&__pyx_f_4taos_7_parser__parse_nchar_string, "PyObject *(size_t, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_string", (void (**)(void))&__pyx_f_4taos_7_parser__parse_string, "PyObject *(size_t, int, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction_3_0_0(__pyx_t_1, "_parse_timestamp", (void (**)(void))&__pyx_f_4taos_7_parser__parse_timestamp, "PyObject *(size_t, int, PyObject *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; -} - - -#if PY_MAJOR_VERSION >= 3 -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec__objects(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec__objects}, - {0, NULL} -}; -#endif - -#ifdef __cplusplus -namespace { - struct PyModuleDef __pyx_moduledef = - #else - static struct PyModuleDef __pyx_moduledef = - #endif - { - PyModuleDef_HEAD_INIT, - "_objects", - 0, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ - #else - -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - #if CYTHON_USE_MODULE_STATE - __pyx_m_traverse, /* m_traverse */ - __pyx_m_clear, /* m_clear */ - NULL /* m_free */ - #else - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ - #endif - }; - #ifdef __cplusplus -} /* anonymous namespace */ -#endif -#endif - -#ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif -#endif - - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC init_objects(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC init_objects(void) -#else -__Pyx_PyMODINIT_FUNC PyInit__objects(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit__objects(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 - static PY_INT64_T main_interpreter_id = -1; - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; - } - return 0; -} -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) -#endif -{ - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else - result = PyDict_SetItemString(moddict, to_name, value); -#endif - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; - } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - CYTHON_UNUSED_VAR(def); - if (__Pyx_check_single_interpreter()) - return NULL; - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; -#endif - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} - - -static CYTHON_SMALL_CODE int __pyx_pymod_exec__objects(PyObject *__pyx_pyinit_module) -#endif -#endif -{ - int stringtab_initialized = 0; - #if CYTHON_USE_MODULE_STATE - int pystate_addmodule_run = 0; - #endif - __Pyx_TraceDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module '_objects' has already been imported. Re-initialisation is not supported."); - return -1; - } - #elif PY_MAJOR_VERSION >= 3 - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); - #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("_objects", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE - __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to _objects pseudovariable */ - if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - pystate_addmodule_run = 1; - } - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #endif - CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__objects(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_taos___objects) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "taos._objects")) { - if (unlikely((PyDict_SetItemString(modules, "taos._objects", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__objects(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); - - /* "taos/_objects.pyx":3 - * # cython: profile=True - * - * from typing import Optional # <<<<<<<<<<<<<< - * from taos._cinterface cimport * - * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_Optional); - __Pyx_GIVEREF(__pyx_n_s_Optional); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Optional); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":6 - * from taos._cinterface cimport * - * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string - * from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC # <<<<<<<<<<<<<< - * import datetime as dt - * import pytz - */ - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_SIZED_TYPE); - __Pyx_GIVEREF(__pyx_n_s_SIZED_TYPE); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SIZED_TYPE); - __Pyx_INCREF(__pyx_n_s_UNSIZED_TYPE); - __Pyx_GIVEREF(__pyx_n_s_UNSIZED_TYPE); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_UNSIZED_TYPE); - __Pyx_INCREF(__pyx_n_s_CONVERT_FUNC); - __Pyx_GIVEREF(__pyx_n_s_CONVERT_FUNC); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_CONVERT_FUNC); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_taos__cinterface, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIZED_TYPE, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_UNSIZED_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNSIZED_TYPE, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CONVERT_FUNC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONVERT_FUNC, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":7 - * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string - * from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC - * import datetime as dt # <<<<<<<<<<<<<< - * import pytz - * from collections import namedtuple - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":8 - * from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC - * import datetime as dt - * import pytz # <<<<<<<<<<<<<< - * from collections import namedtuple - * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_pytz, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":9 - * import datetime as dt - * import pytz - * from collections import namedtuple # <<<<<<<<<<<<<< - * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError - * - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_namedtuple); - __Pyx_GIVEREF(__pyx_n_s_namedtuple); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":10 - * import pytz - * from collections import namedtuple - * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError # <<<<<<<<<<<<<< - * - * _priv_tz = None - */ - __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_ProgrammingError); - __Pyx_GIVEREF(__pyx_n_s_ProgrammingError); - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ProgrammingError); - __Pyx_INCREF(__pyx_n_s_OperationalError); - __Pyx_GIVEREF(__pyx_n_s_OperationalError); - PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_OperationalError); - __Pyx_INCREF(__pyx_n_s_ConnectionError); - __Pyx_GIVEREF(__pyx_n_s_ConnectionError); - PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_ConnectionError); - __Pyx_INCREF(__pyx_n_s_DatabaseError); - __Pyx_GIVEREF(__pyx_n_s_DatabaseError); - PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_DatabaseError); - __Pyx_INCREF(__pyx_n_s_StatementError); - __Pyx_GIVEREF(__pyx_n_s_StatementError); - PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_StatementError); - __Pyx_INCREF(__pyx_n_s_InternalError); - __Pyx_GIVEREF(__pyx_n_s_InternalError); - PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_s_InternalError); - __Pyx_INCREF(__pyx_n_s_TmqError); - __Pyx_GIVEREF(__pyx_n_s_TmqError); - PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_s_TmqError); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_taos_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProgrammingError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OperationalError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConnectionError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DatabaseError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StatementError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_StatementError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InternalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InternalError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_TmqError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TmqError, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":12 - * from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError - * - * _priv_tz = None # <<<<<<<<<<<<<< - * _utc_tz = pytz.timezone("UTC") - * try: - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_priv_tz, Py_None) < 0) __PYX_ERR(0, 12, __pyx_L1_error) - - /* "taos/_objects.pyx":13 - * - * _priv_tz = None - * _utc_tz = pytz.timezone("UTC") # <<<<<<<<<<<<<< - * try: - * _datetime_epoch = dt.datetime.fromtimestamp(0) - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pytz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timezone); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc_tz, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_objects.pyx":14 - * _priv_tz = None - * _utc_tz = pytz.timezone("UTC") - * try: # <<<<<<<<<<<<<< - * _datetime_epoch = dt.datetime.fromtimestamp(0) - * except OSError: - */ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_t_5); - /*try:*/ { - - /* "taos/_objects.pyx":15 - * _utc_tz = pytz.timezone("UTC") - * try: - * _datetime_epoch = dt.datetime.fromtimestamp(0) # <<<<<<<<<<<<<< - * except OSError: - * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fromtimestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_epoch, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L2_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":14 - * _priv_tz = None - * _utc_tz = pytz.timezone("UTC") - * try: # <<<<<<<<<<<<<< - * _datetime_epoch = dt.datetime.fromtimestamp(0) - * except OSError: - */ - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L7_try_end; - __pyx_L2_error:; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":16 - * try: - * _datetime_epoch = dt.datetime.fromtimestamp(0) - * except OSError: # <<<<<<<<<<<<<< - * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) - * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) - */ - __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError); - if (__pyx_t_6) { - __Pyx_AddTraceback("taos._objects", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 16, __pyx_L4_except_error) - __Pyx_XGOTREF(__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_7); - - /* "taos/_objects.pyx":17 - * _datetime_epoch = dt.datetime.fromtimestamp(0) - * except OSError: - * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) # <<<<<<<<<<<<<< - * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) - * _priv_datetime_epoch = None - */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_dt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_fromtimestamp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_dt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_seconds, __pyx_int_86400) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error) - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Subtract(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime_epoch, __pyx_t_8) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L3_exception_handled; - } - goto __pyx_L4_except_error; - - /* "taos/_objects.pyx":14 - * _priv_tz = None - * _utc_tz = pytz.timezone("UTC") - * try: # <<<<<<<<<<<<<< - * _datetime_epoch = dt.datetime.fromtimestamp(0) - * except OSError: - */ - __pyx_L4_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); - goto __pyx_L1_error; - __pyx_L3_exception_handled:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_4); - __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); - __pyx_L7_try_end:; - } - - /* "taos/_objects.pyx":18 - * except OSError: - * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) - * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) # <<<<<<<<<<<<<< - * _priv_datetime_epoch = None - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_utc_tz); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_localize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_dt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_utcfromtimestamp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc_datetime_epoch, __pyx_t_7) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "taos/_objects.pyx":19 - * _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) - * _utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) - * _priv_datetime_epoch = None # <<<<<<<<<<<<<< - * - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_priv_datetime_epoch, Py_None) < 0) __PYX_ERR(0, 19, __pyx_L1_error) - - /* "taos/_objects.pyx":22 - * - * - * def set_tz(tz): # <<<<<<<<<<<<<< - * global _priv_tz, _priv_datetime_epoch - * _priv_tz = tz - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_1set_tz, 0, __pyx_n_s_set_tz, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_tz, __pyx_t_7) < 0) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "taos/_objects.pyx":88 - * self._check_conn_error() - * - * def _init_options(self): # <<<<<<<<<<<<<< - * if self._tz: - * tz = self._tz - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_3_init_options, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection__init_options, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_init_options, __pyx_t_7) < 0) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":97 - * taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) - * - * def _init_conn(self): # <<<<<<<<<<<<<< - * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - * - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_5_init_conn, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection__init_conn, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_init_conn, __pyx_t_7) < 0) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":100 - * self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) - * - * def _check_conn_error(self): # <<<<<<<<<<<<<< - * errno = taos_errno(self._raw_conn) - * if errno != 0: - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_7_check_conn_error, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection__check_conn_error, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_check_conn_error, __pyx_t_7) < 0) __PYX_ERR(0, 100, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":109 - * self.close() - * - * def close(self): # <<<<<<<<<<<<<< - * if self._raw_conn is not NULL: - * taos_close(self._raw_conn) - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_11close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_close, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 109, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_close, __pyx_t_7) < 0) __PYX_ERR(0, 109, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":125 - * return taos_get_server_info(self._raw_conn).decode("utf-8") - * - * def select_db(self, database: str): # <<<<<<<<<<<<<< - * _database = database.encode("utf-8") - * res = taos_select_db(self._raw_conn, _database) - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_database, __pyx_n_s_str) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_13select_db, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_select_db, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_select_db, __pyx_t_3) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":131 - * raise DatabaseError("select database error", res) - * - * def execute(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * return self.query(sql, req_id).affected_rows - * - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sql, __pyx_n_s_str) < 0) __PYX_ERR(0, 131, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_req_id, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 131, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_15execute, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_execute, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__74); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_execute, __pyx_t_7) < 0) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":134 - * return self.query(sql, req_id).affected_rows - * - * def query(self, sql: str, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * _sql = sql.encode("utf-8") - * if req_id is None: - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_sql, __pyx_n_s_str) < 0) __PYX_ERR(0, 134, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_req_id, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 134, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_17query, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_query, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__74); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_query, __pyx_t_3) < 0) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":143 - * return TaosResult(res) - * - * def query_a(self, sql: str, callback, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * _sql = sql.encode("utf-8") - * if req_id is None: - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sql, __pyx_n_s_str) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_req_id, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_19query_a, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_query_a, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__74); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_query_a, __pyx_t_7) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":150 - * taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) - * - * def subscribe(self, configs: dict[str, str], callback): # <<<<<<<<<<<<<< - * if self._raw_conn is NULL: - * return None - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_configs, __pyx_kp_s_dict_str_str) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_21subscribe, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_subscribe, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_subscribe, __pyx_t_3) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":161 - * print("tmq_conf_res:", tmq_conf_res) - * - * def load_table_info(self, tables: list): # <<<<<<<<<<<<<< - * # type: (str) -> None - * _tables = ",".join(tables).encode("utf-8") - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tables, __pyx_n_s_list) < 0) __PYX_ERR(0, 161, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_23load_table_info, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_load_table_info, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_load_table_info, __pyx_t_7) < 0) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":166 - * taos_load_table_info(self._raw_conn, _tables) - * - * def commit(self): # <<<<<<<<<<<<<< - * """Commit any pending transaction to the database. - * - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_25commit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_commit, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_commit, __pyx_t_7) < 0) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":173 - * pass - * - * def rollback(self): # <<<<<<<<<<<<<< - * """Void functionality""" - * pass - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_27rollback, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_rollback, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_rollback, __pyx_t_7) < 0) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":177 - * pass - * - * def clear_result_set(self): # <<<<<<<<<<<<<< - * """Clear unused result set on this connection.""" - * pass - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_29clear_result_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_clear_result_set, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_clear_result_set, __pyx_t_7) < 0) __PYX_ERR(0, 177, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "taos/_objects.pyx":181 - * pass - * - * def get_table_vgroup_id(self, db: str, table: str): # <<<<<<<<<<<<<< - * # type: (str, str) -> int - * """ - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_db, __pyx_n_s_str) < 0) __PYX_ERR(0, 181, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_table, __pyx_n_s_str) < 0) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_31get_table_vgroup_id, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection_get_table_vgroup, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConnection->tp_dict, __pyx_n_s_get_table_vgroup_id, __pyx_t_3) < 0) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConnection); - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_14TaosConnection_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConnection___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_9TaosField_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosField___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_9TaosField_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosField___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":277 - * return self._row_count - * - * def _check_result_error(self): # <<<<<<<<<<<<<< - * errno = taos_errno(self._res) - * if errno != 0: - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_9_check_result_error, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult__check_result_error, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_check_result_error, __pyx_t_3) < 0) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); - - /* "taos/_objects.pyx":283 - * raise ProgrammingError(errstr, errno) - * - * def _fetch_block(self): # <<<<<<<<<<<<<< - * cdef TAOS_ROW pblock - * num_of_rows = taos_fetch_block(self._res, &pblock) - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_11_fetch_block, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult__fetch_block, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_block, __pyx_t_3) < 0) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); - - /* "taos/_objects.pyx":310 - * return blocks, abs(num_of_rows) - * - * def fetch_block(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetch iterator") - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_13fetch_block, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_fetch_block, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_block_2, __pyx_t_3) < 0) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); - - /* "taos/_objects.pyx":319 - * return [r for r in map(tuple, zip(*block))], num_of_rows - * - * def fetch_all(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_15fetch_all, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_fetch_all, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_all, __pyx_t_3) < 0) __PYX_ERR(0, 319, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); - - /* "taos/_objects.pyx":336 - * return [r for b in blocks for r in map(tuple, zip(*b))] - * - * def fetch_all_into_dict(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of fetchall") - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_17fetch_all_into_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_fetch_all_into_dict, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_all_into_dict, __pyx_t_3) < 0) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); - - /* "taos/_objects.pyx":355 - * return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] - * - * def rows_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_19rows_iter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_rows_iter, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_rows_iter, __pyx_t_3) < 0) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); - - /* "taos/_objects.pyx":387 - * yield row - * - * def blocks_iter(self): # <<<<<<<<<<<<<< - * if self._res is NULL: - * raise OperationalError("Invalid use of rows_iter") - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_22blocks_iter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_blocks_iter, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_blocks_iter, __pyx_t_3) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); - - /* "taos/_objects.pyx":399 - * yield [r for r in map(tuple, zip(*block))], num_of_rows - * - * def fetch_rows_a(self, callback): # <<<<<<<<<<<<<< - * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) - * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_25fetch_rows_a, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_fetch_rows_a, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_fetch_rows_a, __pyx_t_3) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); - - /* "taos/_objects.pyx":402 - * taos_fetch_rows_a(self._res, async_callback_wrapper, callback) - * - * def taos_fetch_raw_block_a(self, callback): # <<<<<<<<<<<<<< - * taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) - * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_27taos_fetch_raw_block_a, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult_taos_fetch_raw_block, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosResult->tp_dict, __pyx_n_s_taos_fetch_raw_block_a, __pyx_t_3) < 0) __PYX_ERR(0, 402, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosResult); - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_31__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosResult_33__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosResult___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":441 - * return self._result.affected_rows - * - * def execute(self, sql, params=None, req_id: Optional[int] = None): # <<<<<<<<<<<<<< - * """Prepare and execute a database operation (query or command).""" - * if not self._connection: - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_req_id, __pyx_kp_s_Optional_int) < 0) __PYX_ERR(0, 441, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_6execute, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor_execute, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__88); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_execute, __pyx_t_7) < 0) __PYX_ERR(0, 441, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); - - /* "taos/_objects.pyx":451 - * self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] - * - * def fetchone(self): # <<<<<<<<<<<<<< - * return next(self) - * - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_8fetchone, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor_fetchone, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_fetchone, __pyx_t_7) < 0) __PYX_ERR(0, 451, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); - - /* "taos/_objects.pyx":454 - * return next(self) - * - * def fetchall(self): # <<<<<<<<<<<<<< - * return [r for r in self] - * - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_10fetchall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor_fetchall, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_fetchall, __pyx_t_7) < 0) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); - - /* "taos/_objects.pyx":457 - * return [r for r in self] - * - * def close(self): # <<<<<<<<<<<<<< - * if self._connection is None: - * return False - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_12close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor_close, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_close, __pyx_t_7) < 0) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); - - /* "taos/_objects.pyx":466 - * return True - * - * def _reset_result(self): # <<<<<<<<<<<<<< - * """Reset the result to unused version.""" - * self._description = [] - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_14_reset_result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor__reset_result, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_reset_result, __pyx_t_7) < 0) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_18__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); - - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_TaosCursor, (type(self), 0x78b1cdf, state) - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_TaosCursor__set_state(self, __pyx_state) - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_10TaosCursor_20__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosCursor___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosCursor->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(1, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosCursor); - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_19TaosTopicAssignment_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosTopicAssignment___reduce_cyt, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_19TaosTopicAssignment_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosTopicAssignment___setstate_c, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "taos/_objects.pyx":525 - * raise Exception("setup tmq failed") - * - * def subscribe(self, topics: list[str]): # <<<<<<<<<<<<<< - * tmq_list = tmq_list_new() - * if tmq_list is NULL: - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_topics, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_3subscribe, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_subscribe, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_subscribe, __pyx_t_3) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":542 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def unsubscribe(self): # <<<<<<<<<<<<<< - * tmq_errno = tmq_unsubscribe(self._tmq) - * if tmq_errno != 0: - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_5unsubscribe, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_unsubscribe, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_unsubscribe, __pyx_t_3) < 0) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":547 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def poll(self, timeout: int): # <<<<<<<<<<<<<< - * res = tmq_consumer_poll(self._tmq, timeout) - * if res is NULL: - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_timeout, __pyx_n_s_int) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_7poll, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_poll, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_poll, __pyx_t_7) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":554 - * return TaosResult(res) - * - * def commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * self.result_commit(taos_res) - * - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 554, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_9commit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_commit, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_commit, __pyx_t_3) < 0) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":557 - * self.result_commit(taos_res) - * - * def result_commit(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) - * if tmq_errno != 0: - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 557, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_11result_commit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_result_commit, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_result_commit, __pyx_t_7) < 0) __PYX_ERR(0, 557, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":562 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def offset_commit(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 562, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vg_id, __pyx_n_s_int) < 0) __PYX_ERR(0, 562, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_offset, __pyx_n_s_int) < 0) __PYX_ERR(0, 562, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_13offset_commit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_offset_commit, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_offset_commit, __pyx_t_3) < 0) __PYX_ERR(0, 562, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":568 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def get_topic_assignment(self, topic: str): # <<<<<<<<<<<<<< - * cdef int32_t num_of_assignment - * cdef tmq_topic_assignment *assignment_ptr = NULL - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 568, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_15get_topic_assignment, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_topic_assignmen, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_topic_assignment, __pyx_t_7) < 0) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":588 - * return topic_assignments - * - * def offset_seek(self, topic: str, vg_id: int, offset: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 588, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vg_id, __pyx_n_s_int) < 0) __PYX_ERR(0, 588, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_offset, __pyx_n_s_int) < 0) __PYX_ERR(0, 588, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_17offset_seek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_offset_seek, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_offset_seek, __pyx_t_3) < 0) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":594 - * raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - * - * def position(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * pos = tmq_position(self._tmq, _topic, vg_id) - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 594, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vg_id, __pyx_n_s_int) < 0) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_19position, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_position, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_position, __pyx_t_7) < 0) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":602 - * return pos - * - * def committed(self, topic: str, vg_id: int): # <<<<<<<<<<<<<< - * _topic = topic.encode("utf-8") - * offset = tmq_committed(self._tmq, _topic, vg_id) - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_topic, __pyx_n_s_str) < 0) __PYX_ERR(0, 602, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vg_id, __pyx_n_s_int) < 0) __PYX_ERR(0, 602, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_21committed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_committed, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_committed, __pyx_t_3) < 0) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":613 - * return offset - * - * def get_topic_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_topic_name(taos_res._res) - * - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 613, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_23get_topic_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_topic_name, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_topic_name, __pyx_t_7) < 0) __PYX_ERR(0, 613, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":616 - * return tmq_get_topic_name(taos_res._res) - * - * def get_db_name(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_db_name(taos_res._res) - * - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 616, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_25get_db_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_db_name, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_db_name, __pyx_t_3) < 0) __PYX_ERR(0, 616, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":619 - * return tmq_get_db_name(taos_res._res) - * - * def get_vgroup_id(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_vgroup_id(taos_res._res) - * - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 619, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_27get_vgroup_id, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_vgroup_id, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_vgroup_id, __pyx_t_7) < 0) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "taos/_objects.pyx":622 - * return tmq_get_vgroup_id(taos_res._res) - * - * def get_vgroup_offset(self, taos_res: TaosResult): # <<<<<<<<<<<<<< - * return tmq_get_vgroup_offset(taos_res._res) - * - */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_taos_res, __pyx_n_s_TaosResult) < 0) __PYX_ERR(0, 622, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_29get_vgroup_offset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer_get_vgroup_offset, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4taos_8_objects_TaosConsumer->tp_dict, __pyx_n_s_get_vgroup_offset, __pyx_t_3) < 0) __PYX_ERR(0, 622, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - PyType_Modified(__pyx_ptype_4taos_8_objects_TaosConsumer); - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer___reduce_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":3 - * def __reduce_cython__(self): - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_12TaosConsumer_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TaosConsumer___setstate_cython, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":1 - * def __pyx_unpickle_TaosCursor(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4taos_8_objects_3__pyx_unpickle_TaosCursor, 0, __pyx_n_s_pyx_unpickle_TaosCursor, NULL, __pyx_n_s_taos__objects, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TaosCursor, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "taos/_objects.pyx":1 - * # cython: profile=True # <<<<<<<<<<<<<< - * - * from typing import Optional - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_TraceReturn(Py_None, 0); - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init taos._objects", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); - } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init taos._objects"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; - #else - return; - #endif -} -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#endif - - - -/* #### Code section: utility_code_def ### */ - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; -#endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); - #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#endif - -/* PyObjectGetAttrStrNoError */ -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } -#endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; - } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); - return res; -} -static CYTHON_INLINE PyObject * -__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return PyList_New(0); - } - res = PyList_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); - return res; -} -#endif - -/* BytesEquals */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result; -#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) - Py_hash_t hash1, hash2; - hash1 = ((PyBytesObject*)s1)->ob_shash; - hash2 = ((PyBytesObject*)s2)->ob_shash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - return (equals == Py_NE); - } -#endif - result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } -#if CYTHON_USE_UNICODE_INTERNALS - { - Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED - hash1 = ((PyASCIIObject*)s1)->hash; - hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - goto return_ne; - } - } -#endif - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - -/* fastcall */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) -{ - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); - for (i = 0; i < n; i++) - { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; - } - for (i = 0; i < n; i++) - { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); - if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error - return kwvalues[i]; - } - } - return NULL; // not found (no exception set) -} -#endif - -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - if (kwds_is_tuple) { - if (pos >= PyTuple_GET_SIZE(kwds)) break; - key = PyTuple_GET_ITEM(kwds, pos); - value = kwvalues[pos]; - pos++; - } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; - } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* Profile */ -#if CYTHON_PROFILE -static int __Pyx_TraceSetupAndCall(PyCodeObject** code, - PyFrameObject** frame, - PyThreadState* tstate, - const char *funcname, - const char *srcfile, - int firstlineno) { - PyObject *type, *value, *traceback; - int retval; - if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { - if (*code == NULL) { - *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); - if (*code == NULL) return 0; - } - *frame = PyFrame_New( - tstate, /*PyThreadState *tstate*/ - *code, /*PyCodeObject *code*/ - __pyx_d, /*PyObject *globals*/ - 0 /*PyObject *locals*/ - ); - if (*frame == NULL) return 0; - if (CYTHON_TRACE && (*frame)->f_trace == NULL) { - Py_INCREF(Py_None); - (*frame)->f_trace = Py_None; - } -#if PY_VERSION_HEX < 0x030400B1 - } else { - (*frame)->f_tstate = tstate; -#endif - } - __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); - retval = 1; - __Pyx_EnterTracing(tstate); - __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); - #if CYTHON_TRACE - if (tstate->c_tracefunc) - retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; - if (retval && tstate->c_profilefunc) - #endif - retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; - __Pyx_LeaveTracing(tstate); - if (retval) { - __Pyx_ErrRestoreInState(tstate, type, value, traceback); - return __Pyx_IsTracing(tstate, 0, 0) && retval; - } else { - Py_XDECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); - return -1; - } -} -static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { - PyCodeObject *py_code = 0; -#if PY_MAJOR_VERSION >= 3 - py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); - if (likely(py_code)) { - py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; - } -#else - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - py_funcname = PyString_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - py_srcfile = PyString_FromString(srcfile); - if (unlikely(!py_srcfile)) goto bad; - py_code = PyCode_New( - 0, - 0, - 0, - CO_OPTIMIZED | CO_NEWLOCALS, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - firstlineno, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); -#endif - return py_code; -} -#endif - -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } -#endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; -#endif - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - if ( -#if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && -#endif - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectFastCall */ -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]); - } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - Py_DECREF(argstuple); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { -#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) - if (__Pyx_IsCyOrPyCFunction(func)) -#else - if (PyCFunction_Check(func)) -#endif - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - } - else if (nargs == 1 && kwargs == NULL) { - if (PyCFunction_Check(func)) - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, args[0]); - } - } - } -#endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - #if PY_VERSION_HEX >= 0x030700A1 - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif - #if CYTHON_VECTORCALL - vectorcallfunc f = _PyVectorcall_Function(func); - if (f) { - return f(func, args, (size_t)nargs, kwargs); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, kwargs); - } - #endif - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); - } - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); -} - -/* decode_c_bytes */ -static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( - const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, - const char* encoding, const char* errors, - PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { - if (unlikely((start < 0) | (stop < 0))) { - if (start < 0) { - start += length; - if (start < 0) - start = 0; - } - if (stop < 0) - stop += length; - } - if (stop > length) - stop = length; - if (unlikely(stop <= start)) - return __Pyx_NewRef(__pyx_empty_unicode); - length = stop - start; - cstring += start; - if (decode_func) { - return decode_func(cstring, length, errors); - } else { - return PyUnicode_Decode(cstring, length, encoding, errors); - } -} - -/* RaiseTooManyValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -/* RaiseNeedMoreValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -/* IterFinish */ -static CYTHON_INLINE int __Pyx_IterFinish(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); - if (unlikely(exc_type)) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) - return -1; - __Pyx_PyErr_Clear(); - return 0; - } - return 0; -} - -/* UnpackItemEndCheck */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } - return __Pyx_IterFinish(); -} - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* KeywordStringCheck */ -static int __Pyx_CheckKeywordStrings( - PyObject *kw, - const char* function_name, - int kw_allowed) -{ - PyObject* key = 0; - Py_ssize_t pos = 0; -#if CYTHON_COMPILING_IN_PYPY - if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) - goto invalid_keyword; - return 1; -#else - if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { - if (unlikely(PyTuple_GET_SIZE(kw) == 0)) - return 1; - if (!kw_allowed) { - key = PyTuple_GET_ITEM(kw, 0); - goto invalid_keyword; - } -#if PY_VERSION_HEX < 0x03090000 - for (pos = 0; pos < PyTuple_GET_SIZE(kw); pos++) { - key = PyTuple_GET_ITEM(kw, pos); - if (unlikely(!PyUnicode_Check(key))) - goto invalid_keyword_type; - } -#endif - return 1; - } - while (PyDict_Next(kw, &pos, &key, 0)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_Check(key))) - #endif - if (unlikely(!PyUnicode_Check(key))) - goto invalid_keyword_type; - } - if (!kw_allowed && unlikely(key)) - goto invalid_keyword; - return 1; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - return 0; -#endif -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif - return 0; -} - -/* WriteUnraisableException */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_PyThreadState_declare -#ifdef WITH_THREAD - PyGILState_STATE state; - if (nogil) - state = PyGILState_Ensure(); - else state = (PyGILState_STATE)0; -#endif - CYTHON_UNUSED_VAR(clineno); - CYTHON_UNUSED_VAR(lineno); - CYTHON_UNUSED_VAR(filename); - CYTHON_MAYBE_UNUSED_VAR(nogil); - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - if (full_traceback) { - Py_XINCREF(old_exc); - Py_XINCREF(old_val); - Py_XINCREF(old_tb); - __Pyx_ErrRestore(old_exc, old_val, old_tb); - PyErr_PrintEx(1); - } - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -#ifdef WITH_THREAD - if (nogil) - PyGILState_Release(state); -#endif -} - -/* decode_c_string */ -static CYTHON_INLINE PyObject* __Pyx_decode_c_string( - const char* cstring, Py_ssize_t start, Py_ssize_t stop, - const char* encoding, const char* errors, - PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { - Py_ssize_t length; - if (unlikely((start < 0) | (stop < 0))) { - size_t slen = strlen(cstring); - if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { - PyErr_SetString(PyExc_OverflowError, - "c-string too long to convert to Python"); - return NULL; - } - length = (Py_ssize_t) slen; - if (start < 0) { - start += length; - if (start < 0) - start = 0; - } - if (stop < 0) - stop += length; - } - if (unlikely(stop <= start)) - return __Pyx_NewRef(__pyx_empty_unicode); - length = stop - start; - cstring += start; - if (decode_func) { - return decode_func(cstring, length, errors); - } else { - return PyUnicode_Decode(cstring, length, encoding, errors); - } -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; - } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectCallNoArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { - PyObject *arg = NULL; - return __Pyx_PyObject_FastCall(func, (&arg)+1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectGetMethod */ -static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { - PyObject *attr; -#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP - __Pyx_TypeName type_name; - PyTypeObject *tp = Py_TYPE(obj); - PyObject *descr; - descrgetfunc f = NULL; - PyObject **dictptr, *dict; - int meth_found = 0; - assert (*method == NULL); - if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { - attr = __Pyx_PyObject_GetAttrStr(obj, name); - goto try_unpack; - } - if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { - return 0; - } - descr = _PyType_Lookup(tp, name); - if (likely(descr != NULL)) { - Py_INCREF(descr); -#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR - if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) - #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif -#endif - { - meth_found = 1; - } else { - f = Py_TYPE(descr)->tp_descr_get; - if (f != NULL && PyDescr_IsData(descr)) { - attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); - Py_DECREF(descr); - goto try_unpack; - } - } - } - dictptr = _PyObject_GetDictPtr(obj); - if (dictptr != NULL && (dict = *dictptr) != NULL) { - Py_INCREF(dict); - attr = __Pyx_PyDict_GetItemStr(dict, name); - if (attr != NULL) { - Py_INCREF(attr); - Py_DECREF(dict); - Py_XDECREF(descr); - goto try_unpack; - } - Py_DECREF(dict); - } - if (meth_found) { - *method = descr; - return 1; - } - if (f != NULL) { - attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); - Py_DECREF(descr); - goto try_unpack; - } - if (likely(descr != NULL)) { - *method = descr; - return 0; - } - type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return 0; -#else - attr = __Pyx_PyObject_GetAttrStr(obj, name); - goto try_unpack; -#endif -try_unpack: -#if CYTHON_UNPACK_METHODS - if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { - PyObject *function = PyMethod_GET_FUNCTION(attr); - Py_INCREF(function); - Py_DECREF(attr); - *method = function; - return 1; - } -#endif - *method = attr; - return 0; -} - -/* PyObjectCallMethod0 */ -static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { - PyObject *method = NULL, *result = NULL; - int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); - if (likely(is_method)) { - result = __Pyx_PyObject_CallOneArg(method, obj); - Py_DECREF(method); - return result; - } - if (unlikely(!method)) goto bad; - result = __Pyx_PyObject_CallNoArg(method); - Py_DECREF(method); -bad: - return result; -} - -/* RaiseNoneIterError */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -/* UnpackTupleError */ -static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { - if (t == Py_None) { - __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); - } else { - __Pyx_RaiseTooManyValuesError(index); - } -} - -/* UnpackTuple2 */ -static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( - PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { - PyObject *value1 = NULL, *value2 = NULL; -#if CYTHON_COMPILING_IN_PYPY - value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; - value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; -#else - value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); - value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); -#endif - if (decref_tuple) { - Py_DECREF(tuple); - } - *pvalue1 = value1; - *pvalue2 = value2; - return 0; -#if CYTHON_COMPILING_IN_PYPY -bad: - Py_XDECREF(value1); - Py_XDECREF(value2); - if (decref_tuple) { Py_XDECREF(tuple); } - return -1; -#endif -} -static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, - int has_known_size, int decref_tuple) { - Py_ssize_t index; - PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; - iternextfunc iternext; - iter = PyObject_GetIter(tuple); - if (unlikely(!iter)) goto bad; - if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } - iternext = __Pyx_PyObject_GetIterNextFunc(iter); - value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } - value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } - if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; - Py_DECREF(iter); - *pvalue1 = value1; - *pvalue2 = value2; - return 0; -unpacking_failed: - if (!has_known_size && __Pyx_IterFinish() == 0) - __Pyx_RaiseNeedMoreValuesError(index); -bad: - Py_XDECREF(iter); - Py_XDECREF(value1); - Py_XDECREF(value2); - if (decref_tuple) { Py_XDECREF(tuple); } - return -1; -} - -/* dict_iter */ -static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, - Py_ssize_t* p_orig_length, int* p_source_is_dict) { - is_dict = is_dict || likely(PyDict_CheckExact(iterable)); - *p_source_is_dict = is_dict; - if (is_dict) { -#if !CYTHON_COMPILING_IN_PYPY - *p_orig_length = PyDict_Size(iterable); - Py_INCREF(iterable); - return iterable; -#elif PY_MAJOR_VERSION >= 3 - static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; - PyObject **pp = NULL; - if (method_name) { - const char *name = PyUnicode_AsUTF8(method_name); - if (strcmp(name, "iteritems") == 0) pp = &py_items; - else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; - else if (strcmp(name, "itervalues") == 0) pp = &py_values; - if (pp) { - if (!*pp) { - *pp = PyUnicode_FromString(name + 4); - if (!*pp) - return NULL; - } - method_name = *pp; - } - } -#endif - } - *p_orig_length = 0; - if (method_name) { - PyObject* iter; - iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); - if (!iterable) - return NULL; -#if !CYTHON_COMPILING_IN_PYPY - if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) - return iterable; -#endif - iter = PyObject_GetIter(iterable); - Py_DECREF(iterable); - return iter; - } - return PyObject_GetIter(iterable); -} -static CYTHON_INLINE int __Pyx_dict_iter_next( - PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, - PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { - PyObject* next_item; -#if !CYTHON_COMPILING_IN_PYPY - if (source_is_dict) { - PyObject *key, *value; - if (unlikely(orig_length != PyDict_Size(iter_obj))) { - PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); - return -1; - } - if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { - return 0; - } - if (pitem) { - PyObject* tuple = PyTuple_New(2); - if (unlikely(!tuple)) { - return -1; - } - Py_INCREF(key); - Py_INCREF(value); - PyTuple_SET_ITEM(tuple, 0, key); - PyTuple_SET_ITEM(tuple, 1, value); - *pitem = tuple; - } else { - if (pkey) { - Py_INCREF(key); - *pkey = key; - } - if (pvalue) { - Py_INCREF(value); - *pvalue = value; - } - } - return 1; - } else if (PyTuple_CheckExact(iter_obj)) { - Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; - *ppos = pos + 1; - next_item = PyTuple_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - } else if (PyList_CheckExact(iter_obj)) { - Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; - *ppos = pos + 1; - next_item = PyList_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - } else -#endif - { - next_item = PyIter_Next(iter_obj); - if (unlikely(!next_item)) { - return __Pyx_IterFinish(); - } - } - if (pitem) { - *pitem = next_item; - } else if (pkey && pvalue) { - if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) - return -1; - } else if (pkey) { - *pkey = next_item; - } else { - *pvalue = next_item; - } - return 1; -} - -/* PyObjectFormatAndDecref */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { - if (unlikely(!s)) return NULL; - if (likely(PyUnicode_CheckExact(s))) return s; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(s))) { - PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); - Py_DECREF(s); - return result; - } - #endif - return __Pyx_PyObject_FormatAndDecref(s, f); -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { - PyObject *result = PyObject_Format(s, f); - Py_DECREF(s); - return result; -} - -/* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char) { -#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyObject *result_uval; - int result_ukind, kind_shift; - Py_ssize_t i, char_pos; - void *result_udata; - CYTHON_MAYBE_UNUSED_VAR(max_char); -#if CYTHON_PEP393_ENABLED - result_uval = PyUnicode_New(result_ulength, max_char); - if (unlikely(!result_uval)) return NULL; - result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; - kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; - result_udata = PyUnicode_DATA(result_uval); -#else - result_uval = PyUnicode_FromUnicode(NULL, result_ulength); - if (unlikely(!result_uval)) return NULL; - result_ukind = sizeof(Py_UNICODE); - kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; - result_udata = PyUnicode_AS_UNICODE(result_uval); -#endif - assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); - char_pos = 0; - for (i=0; i < value_count; i++) { - int ukind; - Py_ssize_t ulength; - void *udata; - PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); - if (unlikely(__Pyx_PyUnicode_READY(uval))) - goto bad; - ulength = __Pyx_PyUnicode_GET_LENGTH(uval); - if (unlikely(!ulength)) - continue; - if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) - goto overflow; - ukind = __Pyx_PyUnicode_KIND(uval); - udata = __Pyx_PyUnicode_DATA(uval); - if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { - memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); - } else { - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) - _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); - #else - Py_ssize_t j; - for (j=0; j < ulength; j++) { - Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); - __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); - } - #endif - } - char_pos += ulength; - } - return result_uval; -overflow: - PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); -bad: - Py_DECREF(result_uval); - return NULL; -#else - CYTHON_UNUSED_VAR(max_char); - CYTHON_UNUSED_VAR(result_ulength); - CYTHON_UNUSED_VAR(value_count); - return PyUnicode_Join(__pyx_empty_unicode, value_tuple); -#endif -} - -/* GetAttr */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { -#if CYTHON_USE_TYPE_SLOTS -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - -/* CIntToDigits */ -static const char DIGIT_PAIRS_10[2*10*10+1] = { - "00010203040506070809" - "10111213141516171819" - "20212223242526272829" - "30313233343536373839" - "40414243444546474849" - "50515253545556575859" - "60616263646566676869" - "70717273747576777879" - "80818283848586878889" - "90919293949596979899" -}; -static const char DIGIT_PAIRS_8[2*8*8+1] = { - "0001020304050607" - "1011121314151617" - "2021222324252627" - "3031323334353637" - "4041424344454647" - "5051525354555657" - "6061626364656667" - "7071727374757677" -}; -static const char DIGITS_HEX[2*16+1] = { - "0123456789abcdef" - "0123456789ABCDEF" -}; - -/* BuildPyUnicode */ -static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, - int prepend_sign, char padding_char) { - PyObject *uval; - Py_ssize_t uoffset = ulength - clength; -#if CYTHON_USE_UNICODE_INTERNALS - Py_ssize_t i; -#if CYTHON_PEP393_ENABLED - void *udata; - uval = PyUnicode_New(ulength, 127); - if (unlikely(!uval)) return NULL; - udata = PyUnicode_DATA(uval); -#else - Py_UNICODE *udata; - uval = PyUnicode_FromUnicode(NULL, ulength); - if (unlikely(!uval)) return NULL; - udata = PyUnicode_AS_UNICODE(uval); -#endif - if (uoffset > 0) { - i = 0; - if (prepend_sign) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); - i++; - } - for (; i < uoffset; i++) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); - } - } - for (i=0; i < clength; i++) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); - } -#else - { - PyObject *sign = NULL, *padding = NULL; - uval = NULL; - if (uoffset > 0) { - prepend_sign = !!prepend_sign; - if (uoffset > prepend_sign) { - padding = PyUnicode_FromOrdinal(padding_char); - if (likely(padding) && uoffset > prepend_sign + 1) { - PyObject *tmp; - PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); - if (unlikely(!repeat)) goto done_or_error; - tmp = PyNumber_Multiply(padding, repeat); - Py_DECREF(repeat); - Py_DECREF(padding); - padding = tmp; - } - if (unlikely(!padding)) goto done_or_error; - } - if (prepend_sign) { - sign = PyUnicode_FromOrdinal('-'); - if (unlikely(!sign)) goto done_or_error; - } - } - uval = PyUnicode_DecodeASCII(chars, clength, NULL); - if (likely(uval) && padding) { - PyObject *tmp = PyNumber_Add(padding, uval); - Py_DECREF(uval); - uval = tmp; - } - if (likely(uval) && sign) { - PyObject *tmp = PyNumber_Add(sign, uval); - Py_DECREF(uval); - uval = tmp; - } -done_or_error: - Py_XDECREF(padding); - Py_XDECREF(sign); - } -#endif - return uval; -} - -/* CIntToPyUnicode */ -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) { - char digits[sizeof(size_t)*3+2]; - char *dpos, *end = digits + sizeof(size_t)*3+2; - const char *hex_digits = DIGITS_HEX; - Py_ssize_t length, ulength; - int prepend_sign, last_one_off; - size_t remaining; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (format_char == 'X') { - hex_digits += 16; - format_char = 'x'; - } - remaining = value; - last_one_off = 0; - dpos = end; - do { - int digit_pos; - switch (format_char) { - case 'o': - digit_pos = abs((int)(remaining % (8*8))); - remaining = (size_t) (remaining / (8*8)); - dpos -= 2; - memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); - last_one_off = (digit_pos < 8); - break; - case 'd': - digit_pos = abs((int)(remaining % (10*10))); - remaining = (size_t) (remaining / (10*10)); - dpos -= 2; - memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); - last_one_off = (digit_pos < 10); - break; - case 'x': - *(--dpos) = hex_digits[abs((int)(remaining % 16))]; - remaining = (size_t) (remaining / 16); - break; - default: - assert(0); - break; - } - } while (unlikely(remaining != 0)); - assert(!last_one_off || *dpos == '0'); - dpos += last_one_off; - length = end - dpos; - ulength = length; - prepend_sign = 0; - if (!is_unsigned && value <= neg_one) { - if (padding_char == ' ' || width <= length + 1) { - *(--dpos) = '-'; - ++length; - } else { - prepend_sign = 1; - } - ++ulength; - } - if (width > ulength) { - ulength = width; - } - if (ulength == 1) { - return PyUnicode_FromOrdinal(*dpos); - } - return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); -} - -/* PyIntCompare */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_UNUSED_VAR(inplace); - if (op1 == op2) { - return 1; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - return (a == b); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - int unequal; - unsigned long uintval; - Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); - const digit* digits = __Pyx_PyLong_Digits(op1); - if (intval == 0) { - return (__Pyx_PyLong_IsZero(op1) == 1); - } else if (intval < 0) { - if (__Pyx_PyLong_IsNonNeg(op1)) - return 0; - intval = -intval; - } else { - if (__Pyx_PyLong_IsNeg(op1)) - return 0; - } - uintval = (unsigned long) intval; -#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 4)) { - unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 3)) { - unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 2)) { - unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 1)) { - unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif - unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); - return (unequal == 0); - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - return ((double)a == (double)b); - } - return __Pyx_PyObject_IsTrueAndDecref( - PyObject_RichCompare(op1, op2, Py_EQ)); -} - -/* SetItemInt */ -static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { - int r; - if (unlikely(!j)) return -1; - r = PyObject_SetItem(o, j, v); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, - CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { - PyObject* old = PyList_GET_ITEM(o, n); - Py_INCREF(v); - PyList_SET_ITEM(o, n, v); - Py_DECREF(old); - return 1; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_ass_subscript) { - int r; - PyObject *key = PyInt_FromSsize_t(i); - if (unlikely(!key)) return -1; - r = mm->mp_ass_subscript(o, key, v); - Py_DECREF(key); - return r; - } - if (likely(sm && sm->sq_ass_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return -1; - PyErr_Clear(); - } - } - return sm->sq_ass_item(o, i, v); - } - } -#else -#if CYTHON_COMPILING_IN_PYPY - if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) -#else - if (is_list || PySequence_Check(o)) -#endif - { - return PySequence_SetItem(o, i, v); - } -#endif - return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); -} - -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (unlikely(!j)) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); - if (unlikely(!key)) return NULL; - r = mm->mp_subscript(o, key); - Py_DECREF(key); - return r; - } - if (likely(sm && sm->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return sm->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -/* py_abs */ -#if CYTHON_USE_PYLONG_INTERNALS -static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { -#if PY_VERSION_HEX >= 0x030C00A7 - if (likely(__Pyx_PyLong_IsCompact(n))) { - return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n)); - } -#else - if (likely(Py_SIZE(n) == -1)) { - return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]); - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - { - PyObject *copy = _PyLong_Copy((PyLongObject*)n); - if (likely(copy)) { - #if PY_VERSION_HEX >= 0x030C00A7 - ((PyLongObject*)copy)->long_value.lv_tag = ((PyLongObject*)copy)->long_value.lv_tag & ~_PyLong_SIGN_MASK; - #else - __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); - #endif - } - return copy; - } -#else - return PyNumber_Negative(n); -#endif -} -#endif - -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) -#endif -{ - PyObject *local_type = NULL, *local_value, *local_tb = NULL; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 - local_value = tstate->current_exception; - tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } - #else - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - #endif -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - #if CYTHON_USE_EXC_INFO_STACK - { - _PyErr_StackItem *exc_info = tstate->exc_info; - #if PY_VERSION_HEX >= 0x030B00a4 - tmp_value = exc_info->exc_value; - exc_info->exc_value = local_value; - tmp_type = NULL; - tmp_tb = NULL; - Py_XDECREF(local_type); - Py_XDECREF(local_tb); - #else - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = local_type; - exc_info->exc_value = local_value; - exc_info->exc_traceback = local_tb; - #endif - } - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -/* pep479 */ -static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; - __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED - int is_async_stopiteration = 0; - #endif - CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); - if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { - is_async_stopiteration = 1; - } else - #endif - return; - } - __Pyx_PyThreadState_assign - __Pyx_GetException(&exc, &val, &tb); - Py_XDECREF(exc); - Py_XDECREF(val); - Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED - is_async_stopiteration ? "async generator raised StopAsyncIteration" : - in_async_gen ? "async generator raised StopIteration" : - #endif - "generator raised StopIteration"); -} - -/* ExtTypeTest */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - __Pyx_TypeName obj_type_name; - __Pyx_TypeName type_name; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(__Pyx_TypeCheck(obj, type))) - return 1; - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_TypeError, - "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, - obj_type_name, type_name); - __Pyx_DECREF_TypeName(obj_type_name); - __Pyx_DECREF_TypeName(type_name); - return 0; -} - -/* IterNext */ -static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { - PyObject* exc_type; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - exc_type = __Pyx_PyErr_CurrentExceptionType(); - if (unlikely(exc_type)) { - if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) - return NULL; - __Pyx_PyErr_Clear(); - Py_INCREF(defval); - return defval; - } - if (defval) { - Py_INCREF(defval); - return defval; - } - __Pyx_PyErr_SetNone(PyExc_StopIteration); - return NULL; -} -static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { - __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetName(Py_TYPE(iterator)); - PyErr_Format(PyExc_TypeError, - __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name); - __Pyx_DECREF_TypeName(iterator_type_name); -} -static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { - PyObject* next; - iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; - if (likely(iternext)) { -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY - next = iternext(iterator); - if (likely(next)) - return next; -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(iternext == &_PyObject_NextNotImplemented)) - return NULL; -#endif -#else - next = PyIter_Next(iterator); - if (likely(next)) - return next; -#endif - } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { - __Pyx_PyIter_Next_ErrorNoIterator(iterator); - return NULL; - } -#if !CYTHON_USE_TYPE_SLOTS - else { - next = PyIter_Next(iterator); - if (likely(next)) - return next; - } -#endif - return __Pyx_PyIter_Next2Default(defval); -} - -/* GetAttr3 */ -static PyObject *__Pyx_GetAttr3Default(PyObject *d) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - return NULL; - __Pyx_PyErr_Clear(); - Py_INCREF(d); - return d; -} -static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { - PyObject *r; -#if CYTHON_USE_TYPE_SLOTS - if (likely(PyString_Check(n))) { - r = __Pyx_PyObject_GetAttrStrNoError(o, n); - if (unlikely(!r) && likely(!PyErr_Occurred())) { - r = __Pyx_NewRef(d); - } - return r; - } -#endif - r = PyObject_GetAttr(o, n); - return (likely(r)) ? r : __Pyx_GetAttr3Default(d); -} - -/* RaiseUnexpectedTypeError */ -static int -__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) -{ - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, - expected, obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, 1); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - #endif - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, level); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif - #endif - } - } -bad: - Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif - return module; -} - -/* ImportFrom */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - const char* module_name_str = 0; - PyObject* module_name = 0; - PyObject* module_dot = 0; - PyObject* full_name = 0; - PyErr_Clear(); - module_name_str = PyModule_GetName(module); - if (unlikely(!module_name_str)) { goto modbad; } - module_name = PyUnicode_FromString(module_name_str); - if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__63); - if (unlikely(!module_dot)) { goto modbad; } - full_name = PyUnicode_Concat(module_dot, name); - if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - { - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - goto modbad; - value = PyObject_GetItem(modules, full_name); - } - #else - value = PyImport_GetModule(full_name); - #endif - modbad: - Py_XDECREF(full_name); - Py_XDECREF(module_dot); - Py_XDECREF(module_name); - } - if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* HasAttr */ -static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { - PyObject *r; - if (unlikely(!__Pyx_PyBaseString_Check(n))) { - PyErr_SetString(PyExc_TypeError, - "hasattr(): attribute name must be string"); - return -1; - } - r = __Pyx_GetAttr(o, n); - if (!r) { - PyErr_Clear(); - return 0; - } else { - Py_DECREF(r); - return 1; - } -} - -/* FixUpExtensionType */ -#if CYTHON_USE_TYPE_SPECS -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - CYTHON_UNUSED_VAR(spec); - CYTHON_UNUSED_VAR(type); -#else - const PyType_Slot *slot = spec->slots; - while (slot && slot->slot && slot->slot != Py_tp_members) - slot++; - if (slot && slot->slot == Py_tp_members) { - int changed = 0; -#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) - const -#endif - PyMemberDef *memb = (PyMemberDef*) slot->pfunc; - while (memb && memb->name) { - if (memb->name[0] == '_' && memb->name[1] == '_') { -#if PY_VERSION_HEX < 0x030900b1 - if (strcmp(memb->name, "__weaklistoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_weaklistoffset = memb->offset; - changed = 1; - } - else if (strcmp(memb->name, "__dictoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_dictoffset = memb->offset; - changed = 1; - } -#if CYTHON_METH_FASTCALL - else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 - type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif - changed = 1; - } -#endif -#else - if ((0)); -#endif -#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON - else if (strcmp(memb->name, "__module__") == 0) { - PyObject *descr; - assert(memb->type == T_OBJECT); - assert(memb->flags == 0 || memb->flags == READONLY); - descr = PyDescr_NewMember(type, memb); - if (unlikely(!descr)) - return -1; - if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { - Py_DECREF(descr); - return -1; - } - Py_DECREF(descr); - changed = 1; - } -#endif - } - memb++; - } - if (changed) - PyType_Modified(type); - } -#endif - return 0; -} -#endif - -/* ValidateBasesTuple */ -#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS -static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { - Py_ssize_t i, n = PyTuple_GET_SIZE(bases); - for (i = 1; i < n; i++) - { - PyObject *b0 = PyTuple_GET_ITEM(bases, i); - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); - return -1; - } -#endif - b = (PyTypeObject*) b0; - if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) - { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); - __Pyx_DECREF_TypeName(b_name); - return -1; - } - if (dictoffset == 0 && b->tp_dictoffset) - { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); - return -1; - } - } - return 0; -} -#endif - -/* PyType_Ready */ -static int __Pyx_PyType_Ready(PyTypeObject *t) { -#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) - (void)__Pyx_PyObject_CallMethod0; -#if CYTHON_USE_TYPE_SPECS - (void)__Pyx_validate_bases_tuple; -#endif - return PyType_Ready(t); -#else - int r; - PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); - if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) - return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) - { - int gc_was_enabled; - #if PY_VERSION_HEX >= 0x030A00b1 - gc_was_enabled = PyGC_Disable(); - (void)__Pyx_PyObject_CallMethod0; - #else - PyObject *ret, *py_status; - PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); - #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); - if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); - if (unlikely(!py_status)) { - Py_DECREF(gc); - return -1; - } - gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); - Py_DECREF(py_status); - if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); - if (unlikely(!ret)) { - Py_DECREF(gc); - return -1; - } - Py_DECREF(ret); - } else if (unlikely(gc_was_enabled == -1)) { - Py_DECREF(gc); - return -1; - } - #endif - t->tp_flags |= Py_TPFLAGS_HEAPTYPE; -#if PY_VERSION_HEX >= 0x030A0000 - t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; -#endif -#else - (void)__Pyx_PyObject_CallMethod0; -#endif - r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) - t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; - #if PY_VERSION_HEX >= 0x030A00b1 - if (gc_was_enabled) - PyGC_Enable(); - #else - if (gc_was_enabled) { - PyObject *tp, *v, *tb; - PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); - if (likely(ret || r == -1)) { - Py_XDECREF(ret); - PyErr_Restore(tp, v, tb); - } else { - Py_XDECREF(tp); - Py_XDECREF(v); - Py_XDECREF(tb); - r = -1; - } - } - Py_DECREF(gc); - #endif - } -#endif - return r; -#endif -} - -/* PyObject_GenericGetAttrNoDict */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; - } - } - return descr; -} -#endif - -/* PyObject_GenericGetAttr */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { - if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { - return PyObject_GenericGetAttr(obj, attr_name); - } - return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); -} -#endif - -/* SetupReduce */ -#if !CYTHON_COMPILING_IN_LIMITED_API -static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { - int ret; - PyObject *name_attr; - name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); - if (likely(name_attr)) { - ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); - } else { - ret = -1; - } - if (unlikely(ret < 0)) { - PyErr_Clear(); - ret = 0; - } - Py_XDECREF(name_attr); - return ret; -} -static int __Pyx_setup_reduce(PyObject* type_obj) { - int ret = 0; - PyObject *object_reduce = NULL; - PyObject *object_getstate = NULL; - PyObject *object_reduce_ex = NULL; - PyObject *reduce = NULL; - PyObject *reduce_ex = NULL; - PyObject *reduce_cython = NULL; - PyObject *setstate = NULL; - PyObject *setstate_cython = NULL; - PyObject *getstate = NULL; -#if CYTHON_USE_PYTYPE_LOOKUP - getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); -#else - getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); - if (!getstate && PyErr_Occurred()) { - goto __PYX_BAD; - } -#endif - if (getstate) { -#if CYTHON_USE_PYTYPE_LOOKUP - object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); -#else - object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); - if (!object_getstate && PyErr_Occurred()) { - goto __PYX_BAD; - } -#endif - if (object_getstate != getstate) { - goto __PYX_GOOD; - } - } -#if CYTHON_USE_PYTYPE_LOOKUP - object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; -#else - object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; -#endif - reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; - if (reduce_ex == object_reduce_ex) { -#if CYTHON_USE_PYTYPE_LOOKUP - object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; -#else - object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; -#endif - reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; - if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { - reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); - if (likely(reduce_cython)) { - ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; - ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; - } else if (reduce == object_reduce || PyErr_Occurred()) { - goto __PYX_BAD; - } - setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); - if (!setstate) PyErr_Clear(); - if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { - setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); - if (likely(setstate_cython)) { - ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; - ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; - } else if (!setstate || PyErr_Occurred()) { - goto __PYX_BAD; - } - } - PyType_Modified((PyTypeObject*)type_obj); - } - } - goto __PYX_GOOD; -__PYX_BAD: - if (!PyErr_Occurred()) { - __Pyx_TypeName type_obj_name = - __Pyx_PyType_GetName((PyTypeObject*)type_obj); - PyErr_Format(PyExc_RuntimeError, - "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); - __Pyx_DECREF_TypeName(type_obj_name); - } - ret = -1; -__PYX_GOOD: -#if !CYTHON_USE_PYTYPE_LOOKUP - Py_XDECREF(object_reduce); - Py_XDECREF(object_reduce_ex); - Py_XDECREF(object_getstate); - Py_XDECREF(getstate); -#endif - Py_XDECREF(reduce); - Py_XDECREF(reduce_ex); - Py_XDECREF(reduce_cython); - Py_XDECREF(setstate); - Py_XDECREF(setstate_cython); - return ret; -} -#endif - -/* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 - PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif - "No module named '%U'", partial_name); -#endif -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; - nparts = PyTuple_GET_SIZE(parts_tuple); - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = PySequence_ITEM(parts_tuple, i); -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } - return module; -} -#endif -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__64; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} - -/* GetTopmostException */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * -__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) -{ - _PyErr_StackItem *exc_info = tstate->exc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; - } - return exc_info; -} -#endif - -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif -} -#endif - -/* FetchSharedCythonModule */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); - if (unlikely(!abi_module)) return NULL; - Py_INCREF(abi_module); - return abi_module; -} - -/* FetchCommonType */ -static int __Pyx_VerifyCachedType(PyObject *cached_type, - const char *name, - Py_ssize_t basicsize, - Py_ssize_t expected_basicsize) { - if (!PyType_Check(cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", name); - return -1; - } - if (basicsize != expected_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - name); - return -1; - } - return 0; -} -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { - PyObject* abi_module; - const char* object_name; - PyTypeObject *cached_type = NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - object_name = strrchr(type->tp_name, '.'); - object_name = object_name ? object_name+1 : type->tp_name; - cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - if (__Pyx_VerifyCachedType( - (PyObject *)cached_type, - object_name, - cached_type->tp_basicsize, - type->tp_basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - if (PyType_Ready(type) < 0) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) - goto bad; - Py_INCREF(type); - cached_type = type; -done: - Py_DECREF(abi_module); - return cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#else -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module, *cached_type = NULL; - const char* object_name = strrchr(spec->name, '.'); - object_name = object_name ? object_name+1 : spec->name; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) return NULL; - cached_type = PyObject_GetAttrString(abi_module, object_name); - if (cached_type) { - Py_ssize_t basicsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; -#else - basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; -#endif - if (__Pyx_VerifyCachedType( - cached_type, - object_name, - basicsize, - spec->basicsize) < 0) { - goto bad; - } - goto done; - } - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; - PyErr_Clear(); - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); - if (unlikely(!cached_type)) goto bad; - if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; -done: - Py_DECREF(abi_module); - assert(cached_type == NULL || PyType_Check(cached_type)); - return (PyTypeObject *) cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} -#endif - -/* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL -static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - PyObject *res = NULL; - PyObject *kwnames; - PyObject **newargs; - PyObject **kwvalues; - Py_ssize_t i, pos; - size_t j; - PyObject *key, *value; - unsigned long keys_are_strings; - Py_ssize_t nkw = PyDict_GET_SIZE(kw); - newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); - if (unlikely(newargs == NULL)) { - PyErr_NoMemory(); - return NULL; - } - for (j = 0; j < nargs; j++) newargs[j] = args[j]; - kwnames = PyTuple_New(nkw); - if (unlikely(kwnames == NULL)) { - PyMem_Free(newargs); - return NULL; - } - kwvalues = newargs + nargs; - pos = i = 0; - keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; - Py_INCREF(key); - Py_INCREF(value); - PyTuple_SET_ITEM(kwnames, i, key); - kwvalues[i] = value; - i++; - } - if (unlikely(!keys_are_strings)) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - goto cleanup; - } - res = vc(func, newargs, nargs, kwnames); -cleanup: - Py_DECREF(kwnames); - for (i = 0; i < nkw; i++) - Py_DECREF(kwvalues[i]); - PyMem_Free(newargs); - return res; -} -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { - return vc(func, args, nargs, NULL); - } - return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); -} -#endif - -/* CythonFunctionShared */ -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { -#if PY_VERSION_HEX < 0x030900B1 - __Pyx_Py_XDECREF_SET( - __Pyx_CyFunction_GetClassObj(f), - ((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#else - __Pyx_Py_XDECREF_SET( - ((PyCMethodObject *) (f))->mm_class, - (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#endif -} -static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) -{ - CYTHON_UNUSED_VAR(closure); - if (unlikely(op->func_doc == NULL)) { - if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 - op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif - if (unlikely(op->func_doc == NULL)) - return NULL; - } else { - Py_INCREF(Py_None); - return Py_None; - } - } - Py_INCREF(op->func_doc); - return op->func_doc; -} -static int -__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (value == NULL) { - value = Py_None; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_doc, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_name == NULL)) { -#if PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#endif - if (unlikely(op->func_name == NULL)) - return NULL; - } - Py_INCREF(op->func_name); - return op->func_name; -} -static int -__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_name, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_qualname); - return op->func_qualname; -} -static int -__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_qualname, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_globals); - return op->func_globals; -} -static PyObject * -__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(op); - CYTHON_UNUSED_VAR(context); - Py_INCREF(Py_None); - return Py_None; -} -static PyObject * -__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) -{ - PyObject* result = (op->func_code) ? op->func_code : Py_None; - CYTHON_UNUSED_VAR(context); - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { - int result = 0; - PyObject *res = op->defaults_getter((PyObject *) op); - if (unlikely(!res)) - return -1; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - op->defaults_tuple = PyTuple_GET_ITEM(res, 0); - Py_INCREF(op->defaults_tuple); - op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); - Py_INCREF(op->defaults_kwdict); - #else - op->defaults_tuple = PySequence_ITEM(res, 0); - if (unlikely(!op->defaults_tuple)) result = -1; - else { - op->defaults_kwdict = PySequence_ITEM(res, 1); - if (unlikely(!op->defaults_kwdict)) result = -1; - } - #endif - Py_DECREF(res); - return result; -} -static int -__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__defaults__ must be set to a tuple object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_tuple; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_tuple; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__kwdefaults__ must be set to a dict object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->defaults_kwdict; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_kwdict; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value || value == Py_None) { - value = NULL; - } else if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__annotations__ must be set to a dict object"); - return -1; - } - Py_XINCREF(value); - __Pyx_Py_XDECREF_SET(op->func_annotations, value); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = op->func_annotations; - CYTHON_UNUSED_VAR(context); - if (unlikely(!result)) { - result = PyDict_New(); - if (unlikely(!result)) return NULL; - op->func_annotations = result; - } - Py_INCREF(result); - return result; -} -static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - int is_coroutine; - CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 - if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; - fromlist = PyList_New(1); - if (unlikely(!fromlist)) return NULL; - Py_INCREF(marker); - PyList_SET_ITEM(fromlist, 0, marker); - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); - Py_DECREF(fromlist); - if (unlikely(!module)) goto ignore; - op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); - Py_DECREF(module); - if (likely(op->func_is_coroutine)) { - return __Pyx_NewRef(op->func_is_coroutine); - } -ignore: - PyErr_Clear(); - } -#endif - op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); - return __Pyx_NewRef(op->func_is_coroutine); -} -static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; -static PyMemberDef __pyx_CyFunction_members[] = { - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, -#if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, -#if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, -#else - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif -#endif -#if PY_VERSION_HEX < 0x030500A0 - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, -#else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, -#endif -#endif - {0, 0, 0, 0, 0} -}; -static PyObject * -__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) -{ - CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 - Py_INCREF(m->func_qualname); - return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif -} -static PyMethodDef __pyx_CyFunction_methods[] = { - {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, - {0, 0, 0, 0} -}; -#if PY_VERSION_HEX < 0x030500A0 -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) -#else -#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) -#endif -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - PyCFunctionObject *cf = (PyCFunctionObject*) op; - if (unlikely(op == NULL)) - return NULL; - op->flags = flags; - __Pyx_CyFunction_weakreflist(op) = NULL; - cf->m_ml = ml; - cf->m_self = (PyObject *) op; - Py_XINCREF(closure); - op->func_closure = closure; - Py_XINCREF(module); - cf->m_module = module; - op->func_dict = NULL; - op->func_name = NULL; - Py_INCREF(qualname); - op->func_qualname = qualname; - op->func_doc = NULL; -#if PY_VERSION_HEX < 0x030900B1 - op->func_classobj = NULL; -#else - ((PyCMethodObject*)op)->mm_class = NULL; -#endif - op->func_globals = globals; - Py_INCREF(op->func_globals); - Py_XINCREF(code); - op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; - op->defaults = NULL; - op->defaults_tuple = NULL; - op->defaults_kwdict = NULL; - op->defaults_getter = NULL; - op->func_annotations = NULL; - op->func_is_coroutine = NULL; -#if CYTHON_METH_FASTCALL - switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { - case METH_NOARGS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; - break; - case METH_O: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; - break; - case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; - break; - case METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; - break; - case METH_VARARGS | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = NULL; - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - Py_DECREF(op); - return NULL; - } -#endif - return (PyObject *) op; -} -static int -__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) -{ - Py_CLEAR(m->func_closure); - Py_CLEAR(((PyCFunctionObject*)m)->m_module); - Py_CLEAR(m->func_dict); - Py_CLEAR(m->func_name); - Py_CLEAR(m->func_qualname); - Py_CLEAR(m->func_doc); - Py_CLEAR(m->func_globals); - Py_CLEAR(m->func_code); -#if PY_VERSION_HEX < 0x030900B1 - Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); -#else - { - PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; - ((PyCMethodObject *) (m))->mm_class = NULL; - Py_XDECREF(cls); - } -#endif - Py_CLEAR(m->defaults_tuple); - Py_CLEAR(m->defaults_kwdict); - Py_CLEAR(m->func_annotations); - Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } - return 0; -} -static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - if (__Pyx_CyFunction_weakreflist(m) != NULL) - PyObject_ClearWeakRefs((PyObject *) m); - __Pyx_CyFunction_clear(m); - __Pyx_PyHeapTypeObject_GC_Del(m); -} -static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - PyObject_GC_UnTrack(m); - __Pyx__CyFunction_dealloc(m); -} -static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) -{ - Py_VISIT(m->func_closure); - Py_VISIT(((PyCFunctionObject*)m)->m_module); - Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); - Py_VISIT(m->func_doc); - Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); - Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); - Py_VISIT(m->defaults_tuple); - Py_VISIT(m->defaults_kwdict); - Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } - return 0; -} -static PyObject* -__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) -{ -#if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", - op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif -} -static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = f->m_ml->ml_meth; - Py_ssize_t size; - switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { - case METH_VARARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 0)) - return (*meth)(self, NULL); - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { - size = PyTuple_GET_SIZE(arg); - if (likely(size == 1)) { - PyObject *result, *arg0; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - arg0 = PyTuple_GET_ITEM(arg, 0); - #else - arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; - #endif - result = (*meth)(self, arg0); - #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(arg0); - #endif - return result; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - return NULL; - } - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); - return NULL; -} -static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); -} -static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { - PyObject *result; - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL - __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); - if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS - return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); -#else - (void) &__Pyx_PyVectorcall_FastCallDict; - return PyVectorcall_Call(func, args, kw); -#endif - } -#endif - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - Py_ssize_t argc; - PyObject *new_args; - PyObject *self; - argc = PyTuple_GET_SIZE(args); - new_args = PyTuple_GetSlice(args, 1, argc); - if (unlikely(!new_args)) - return NULL; - self = PyTuple_GetItem(args, 0); - if (unlikely(!self)) { - Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 - PyErr_Format(PyExc_TypeError, - "unbound method %.200S() needs an argument", - cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif - return NULL; - } - result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); - Py_DECREF(new_args); - } else { - result = __Pyx_CyFunction_Call(func, args, kw); - } - return result; -} -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) -{ - int ret = 0; - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - ret = 1; - } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); - return -1; - } - return ret; -} -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, NULL); -} -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); - return NULL; - } - return def->ml_meth(self, args[0]); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; - PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: - self = ((PyCFunctionObject*)cyfunc)->m_self; - break; - default: - return NULL; - } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); -} -#endif -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_CyFunctionType_slots[] = { - {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, - {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, - {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, - {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, - {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, - {Py_tp_methods, (void *)__pyx_CyFunction_methods}, - {Py_tp_members, (void *)__pyx_CyFunction_members}, - {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, - {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, - {0, 0}, -}; -static PyType_Spec __pyx_CyFunctionType_spec = { - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -#else -static PyTypeObject __pyx_CyFunctionType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, - (destructor) __Pyx_CyFunction_dealloc, -#if !CYTHON_METH_FASTCALL - 0, -#elif CYTHON_BACKPORT_VECTORCALL - (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), -#else - offsetof(PyCFunctionObject, vectorcall), -#endif - 0, - 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else - 0, -#endif - (reprfunc) __Pyx_CyFunction_repr, - 0, - 0, - 0, - 0, - __Pyx_CyFunction_CallAsMethod, - 0, - 0, - 0, - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#ifdef _Py_TPFLAGS_HAVE_VECTORCALL - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - 0, - (traverseproc) __Pyx_CyFunction_traverse, - (inquiry) __Pyx_CyFunction_clear, - 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else - offsetof(PyCFunctionObject, m_weakreflist), -#endif - 0, - 0, - __pyx_CyFunction_methods, - __pyx_CyFunction_members, - __pyx_CyFunction_getsets, - 0, - 0, - __Pyx_PyMethod_New, - 0, - offsetof(__pyx_CyFunctionObject, func_dict), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif -}; -#endif -static int __pyx_CyFunction_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); -#endif - if (unlikely(__pyx_CyFunctionType == NULL)) { - return -1; - } - return 0; -} -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); - if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -/* CythonFunction */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), - ml, flags, qualname, closure, module, globals, code - ); - if (likely(op)) { - PyObject_GC_Track(op); - } - return op; -} - -/* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; - PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif - CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { - return c_line; - } - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); - if (likely(cython_runtime_dict)) { - __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { - c_line = 0; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - return c_line; -} -#endif - -/* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} -#endif - -/* AddTraceback */ -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); - } - _PyTraceback_Add(funcname, filename, py_line); -} -#else -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = NULL; - PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - funcname = PyUnicode_AsUTF8(py_funcname); - if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif - } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else - py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline - return py_code; -bad: - Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject *ptype, *pvalue, *ptraceback; - if (c_line) { - c_line = __Pyx_CLineForTraceback(tstate, c_line); - } - py_code = __pyx_find_code_object(c_line ? -c_line : py_line); - if (!py_code) { - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) { - /* If the code object creation fails, then we should clear the - fetched exception references and propagate the new exception */ - Py_XDECREF(ptype); - Py_XDECREF(pvalue); - Py_XDECREF(ptraceback); - goto bad; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); - } - py_frame = PyFrame_New( - tstate, /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} -#endif - -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntFromPy */ -static CYTHON_INLINE int8_t __Pyx_PyInt_As_int8_t(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int8_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int8_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int8_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int8_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int8_t) >= 2 * PyLong_SHIFT)) { - return (int8_t) (((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int8_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int8_t) >= 3 * PyLong_SHIFT)) { - return (int8_t) (((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int8_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int8_t) >= 4 * PyLong_SHIFT)) { - return (int8_t) (((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int8_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int8_t) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int8_t) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT)) { - return (int8_t) (((int8_t)-1)*(((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int8_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT)) { - return (int8_t) ((((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT)) { - return (int8_t) (((int8_t)-1)*(((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int8_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT)) { - return (int8_t) ((((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT)) { - return (int8_t) (((int8_t)-1)*(((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int8_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT)) { - return (int8_t) ((((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int8_t) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int8_t, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int8_t) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int8_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int8_t) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int8_t) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int8_t) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int8_t) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int8_t) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int8_t) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int8_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int8_t) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int8_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int8_t) 1) << (sizeof(int8_t) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (int8_t) -1; - } - } else { - int8_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int8_t) -1; - val = __Pyx_PyInt_As_int8_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int8_t"); - return (int8_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int8_t"); - return (int8_t) -1; -} - -/* CIntFromPy */ -static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int32_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int32_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) { - return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) { - return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) { - return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int32_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int32_t) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { - return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { - return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { - return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { - return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { - return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { - return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int32_t) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int32_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int32_t) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int32_t) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int32_t) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int32_t) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int32_t) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int32_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int32_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (int32_t) -1; - } - } else { - int32_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int32_t) -1; - val = __Pyx_PyInt_As_int32_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int32_t"); - return (int32_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int32_t"); - return (int32_t) -1; -} - -/* CIntFromPy */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(size_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (size_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { - return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { - return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { - return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (size_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(size_t) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { - return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { - return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { - return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { - return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { - return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { - return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(size_t) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - size_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (size_t) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (size_t) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (size_t) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (size_t) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (size_t) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((size_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((size_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (size_t) -1; - } - } else { - size_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (size_t) -1; - val = __Pyx_PyInt_As_size_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to size_t"); - return (size_t) -1; -} - -/* CIntFromPy */ -static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int64_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int64_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) { - return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) { - return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) { - return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int64_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int64_t) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { - return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { - return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { - return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { - return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { - return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { - return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int64_t) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int64_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int64_t) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int64_t) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int64_t) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int64_t) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int64_t) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int64_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int64_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (int64_t) -1; - } - } else { - int64_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int64_t) -1; - val = __Pyx_PyInt_As_int64_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int64_t"); - return (int64_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int64_t"); - return (int64_t) -1; -} - -/* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (long) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (long) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (long) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int8_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int8_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int8_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int8_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int32_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int32_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int32_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int32_t), - little, !is_unsigned); - } -} - -/* CIntFromPy */ -static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(uint16_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (uint16_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT)) { - return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT)) { - return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT)) { - return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (uint16_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(uint16_t) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { - return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { - return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { - return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { - return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { - return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) { - return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(uint16_t) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(uint16_t) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - uint16_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (uint16_t) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (uint16_t) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (uint16_t) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (uint16_t) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (uint16_t) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(uint16_t) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((uint16_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(uint16_t) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((uint16_t) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((uint16_t) 1) << (sizeof(uint16_t) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (uint16_t) -1; - } - } else { - uint16_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (uint16_t) -1; - val = __Pyx_PyInt_As_uint16_t(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to uint16_t"); - return (uint16_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to uint16_t"); - return (uint16_t) -1; -} - -/* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int64_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int64_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int64_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int64_t), - little, !is_unsigned); - } -} - -/* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API -static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) -{ - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name_2); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__101)); - } - return name; -} -#endif - -/* FastTypeChecks */ -#if CYTHON_COMPILING_IN_CPYTHON -static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { - while (a) { - a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); - if (a == b) - return 1; - } - return b == &PyBaseObject_Type; -} -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (a == b) return 1; - mro = a->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(a, b); -} -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (cls == a || cls == b) return 1; - mro = cls->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - PyObject *base = PyTuple_GET_ITEM(mro, i); - if (base == (PyObject *)a || base == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else -static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { - if (exc_type1) { - return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); - } else { - return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); - } -} -#endif -static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - assert(PyExceptionClass_Check(exc_type)); - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_value = exc_info->exc_value; - exc_info->exc_value = *value; - if (tmp_value == NULL || tmp_value == Py_None) { - Py_XDECREF(tmp_value); - tmp_value = NULL; - tmp_type = NULL; - tmp_tb = NULL; - } else { - tmp_type = (PyObject*) Py_TYPE(tmp_value); - Py_INCREF(tmp_type); - #if CYTHON_COMPILING_IN_CPYTHON - tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; - Py_XINCREF(tmp_tb); - #else - tmp_tb = PyException_GetTraceback(tmp_value); - #endif - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = *type; - exc_info->exc_value = *value; - exc_info->exc_traceback = *tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - #endif - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; -} -#else -static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); - PyErr_SetExcInfo(*type, *value, *tb); - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; -} -#endif - -/* PyObjectCall2Args */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { - PyObject *args[3] = {NULL, arg1, arg2}; - return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectCallMethod1 */ -static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { - PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); - Py_DECREF(method); - return result; -} -static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { - PyObject *method = NULL, *result; - int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); - if (likely(is_method)) { - result = __Pyx_PyObject_Call2Args(method, obj, arg); - Py_DECREF(method); - return result; - } - if (unlikely(!method)) return NULL; - return __Pyx__PyObject_CallMethod1(method, arg); -} - -/* CoroutineBase */ -#include -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) -static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { - PyObject *et, *ev, *tb; - PyObject *value = NULL; - CYTHON_UNUSED_VAR(__pyx_tstate); - __Pyx_ErrFetch(&et, &ev, &tb); - if (!et) { - Py_XDECREF(tb); - Py_XDECREF(ev); - Py_INCREF(Py_None); - *pvalue = Py_None; - return 0; - } - if (likely(et == PyExc_StopIteration)) { - if (!ev) { - Py_INCREF(Py_None); - value = Py_None; - } -#if PY_VERSION_HEX >= 0x030300A0 - else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { - value = ((PyStopIterationObject *)ev)->value; - Py_INCREF(value); - Py_DECREF(ev); - } -#endif - else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - value = PyTuple_GET_ITEM(ev, 0); - Py_INCREF(value); -#else - value = PySequence_ITEM(ev, 0); -#endif - } else { - Py_INCREF(Py_None); - value = Py_None; - } - Py_DECREF(ev); - } - else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { - value = ev; - } - if (likely(value)) { - Py_XDECREF(tb); - Py_DECREF(et); - *pvalue = value; - return 0; - } - } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - PyErr_NormalizeException(&et, &ev, &tb); - if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - Py_XDECREF(tb); - Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 - value = ((PyStopIterationObject *)ev)->value; - Py_INCREF(value); - Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } -#endif - *pvalue = value; - return 0; -} -static CYTHON_INLINE -void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { -#if PY_VERSION_HEX >= 0x030B00a4 - Py_CLEAR(exc_state->exc_value); -#else - PyObject *t, *v, *tb; - t = exc_state->exc_type; - v = exc_state->exc_value; - tb = exc_state->exc_traceback; - exc_state->exc_type = NULL; - exc_state->exc_value = NULL; - exc_state->exc_traceback = NULL; - Py_XDECREF(t); - Py_XDECREF(v); - Py_XDECREF(tb); -#endif -} -#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { - msg = "coroutine already executing"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { - msg = "async generator already executing"; - #endif - } else { - msg = "generator already executing"; - } - PyErr_SetString(PyExc_ValueError, msg); -} -#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(gen)) { - msg = "can't send non-None value to a just-started coroutine"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a just-started async generator"; - #endif - } else { - msg = "can't send non-None value to a just-started generator"; - } - PyErr_SetString(PyExc_TypeError, msg); -} -#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { - CYTHON_MAYBE_UNUSED_VAR(gen); - CYTHON_MAYBE_UNUSED_VAR(closing); - #ifdef __Pyx_Coroutine_USED - if (!closing && __Pyx_Coroutine_Check(gen)) { - PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); - } else - #endif - if (value) { - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); - else - #endif - PyErr_SetNone(PyExc_StopIteration); - } -} -static -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { - __Pyx_PyThreadState_declare - PyThreadState *tstate; - __Pyx_ExcInfoStruct *exc_state; - PyObject *retval; - assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - return __Pyx_Coroutine_NotStartedError((PyObject*)self); - } - } - if (unlikely(self->resume_label == -1)) { - return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); - } -#if CYTHON_FAST_THREAD_STATE - __Pyx_PyThreadState_assign - tstate = __pyx_tstate; -#else - tstate = __Pyx_PyThreadState_Current; -#endif - exc_state = &self->gi_exc_state; - if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_PYPY - #else - PyObject *exc_tb; - #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON - exc_tb = PyException_GetTraceback(exc_state->exc_value); - #elif PY_VERSION_HEX >= 0x030B00a4 - exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; - #else - exc_tb = exc_state->exc_traceback; - #endif - if (exc_tb) { - PyTracebackObject *tb = (PyTracebackObject *) exc_tb; - PyFrameObject *f = tb->tb_frame; - assert(f->f_back == NULL); - #if PY_VERSION_HEX >= 0x030B00A1 - f->f_back = PyThreadState_GetFrame(tstate); - #else - Py_XINCREF(tstate->frame); - f->f_back = tstate->frame; - #endif - #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON - Py_DECREF(exc_tb); - #endif - } - #endif - } -#if CYTHON_USE_EXC_INFO_STACK - exc_state->previous_item = tstate->exc_info; - tstate->exc_info = exc_state; -#else - if (exc_state->exc_type) { - __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); - } else { - __Pyx_Coroutine_ExceptionClear(exc_state); - __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); - } -#endif - self->is_running = 1; - retval = self->body(self, tstate, value); - self->is_running = 0; -#if CYTHON_USE_EXC_INFO_STACK - exc_state = &self->gi_exc_state; - tstate->exc_info = exc_state->previous_item; - exc_state->previous_item = NULL; - __Pyx_Coroutine_ResetFrameBackpointer(exc_state); -#endif - return retval; -} -static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY - CYTHON_UNUSED_VAR(exc_state); -#else - PyObject *exc_tb; - #if PY_VERSION_HEX >= 0x030B00a4 - if (!exc_state->exc_value) return; - exc_tb = PyException_GetTraceback(exc_state->exc_value); - #else - exc_tb = exc_state->exc_traceback; - #endif - if (likely(exc_tb)) { - PyTracebackObject *tb = (PyTracebackObject *) exc_tb; - PyFrameObject *f = tb->tb_frame; - Py_CLEAR(f->f_back); - #if PY_VERSION_HEX >= 0x030B00a4 - Py_DECREF(exc_tb); - #endif - } -#endif -} -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { - CYTHON_MAYBE_UNUSED_VAR(gen); - if (unlikely(!retval)) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (!__Pyx_PyErr_Occurred()) { - PyObject *exc = PyExc_StopIteration; - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - exc = __Pyx_PyExc_StopAsyncIteration; - #endif - __Pyx_PyErr_SetNone(exc); - } - } - return retval; -} -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) -static CYTHON_INLINE -PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { -#if PY_VERSION_HEX <= 0x030A00A1 - return _PyGen_Send(gen, arg); -#else - PyObject *result; - if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { - if (PyAsyncGen_CheckExact(gen)) { - assert(result == Py_None); - PyErr_SetNone(PyExc_StopAsyncIteration); - } - else if (result == Py_None) { - PyErr_SetNone(PyExc_StopIteration); - } - else { - _PyGen_SetStopIterationValue(result); - } - Py_CLEAR(result); - } - return result; -#endif -} -#endif -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; - PyObject *val = NULL; - __Pyx_Coroutine_Undelegate(gen); - __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - ret = __Pyx_Coroutine_SendEx(gen, val, 0); - Py_XDECREF(val); - return ret; -} -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { - PyObject *ret; - gen->is_running = 1; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Coroutine_Send(yf, value); - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { - ret = __Pyx_Coroutine_Send(yf, value); - } else - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_PyAsyncGenASend_CheckExact(yf)) { - ret = __Pyx_async_gen_asend_send(yf, value); - } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); - } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyCoro_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); - } else - #endif - { - if (value == Py_None) - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); - else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); - } - gen->is_running = 0; - if (likely(ret)) { - return ret; - } - retval = __Pyx_Coroutine_FinishDelegation(gen); - } else { - retval = __Pyx_Coroutine_SendEx(gen, value, 0); - } - return __Pyx_Coroutine_MethodReturn(self, retval); -} -static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { - PyObject *retval = NULL; - int err = 0; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; - } else - if (__Pyx_CoroutineAwait_CheckExact(yf)) { - retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); - if (!retval) - return -1; - } else - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_PyAsyncGenASend_CheckExact(yf)) { - retval = __Pyx_async_gen_asend_close(yf, NULL); - } else - if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { - retval = __Pyx_async_gen_athrow_close(yf, NULL); - } else - #endif - { - PyObject *meth; - gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); - if (unlikely(!meth)) { - if (unlikely(PyErr_Occurred())) { - PyErr_WriteUnraisable(yf); - } - } else { - retval = __Pyx_PyObject_CallNoArg(meth); - Py_DECREF(meth); - if (unlikely(!retval)) - err = -1; - } - gen->is_running = 0; - } - Py_XDECREF(retval); - return err; -} -static PyObject *__Pyx_Generator_Next(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { - PyObject *ret; - gen->is_running = 1; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Generator_Next(yf); - } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { - ret = __Pyx_Coroutine_Send(yf, Py_None); - } else - #endif - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); - gen->is_running = 0; - if (likely(ret)) { - return ret; - } - return __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_SendEx(gen, Py_None, 0); -} -static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { - CYTHON_UNUSED_VAR(arg); - return __Pyx_Coroutine_Close(self); -} -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; - PyObject *yf = gen->yieldfrom; - int err = 0; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { - Py_INCREF(yf); - err = __Pyx_Coroutine_CloseIter(gen, yf); - __Pyx_Coroutine_Undelegate(gen); - Py_DECREF(yf); - } - if (err == 0) - PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); - if (unlikely(retval)) { - const char *msg; - Py_DECREF(retval); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(self)) { - msg = "coroutine ignored GeneratorExit"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(self)) { -#if PY_VERSION_HEX < 0x03060000 - msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; -#else - msg = "async generator ignored GeneratorExit"; -#endif - #endif - } else { - msg = "generator ignored GeneratorExit"; - } - PyErr_SetString(PyExc_RuntimeError, msg); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; - } - return NULL; -} -static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, - PyObject *args, int close_on_genexit) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { - PyObject *ret; - Py_INCREF(yf); - if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { - int err = __Pyx_Coroutine_CloseIter(gen, yf); - Py_DECREF(yf); - __Pyx_Coroutine_Undelegate(gen); - if (err < 0) - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); - goto throw_here; - } - gen->is_running = 1; - if (0 - #ifdef __Pyx_Generator_USED - || __Pyx_Generator_CheckExact(yf) - #endif - #ifdef __Pyx_Coroutine_USED - || __Pyx_Coroutine_Check(yf) - #endif - ) { - ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); - #endif - } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); - if (unlikely(!meth)) { - Py_DECREF(yf); - if (unlikely(PyErr_Occurred())) { - gen->is_running = 0; - return NULL; - } - __Pyx_Coroutine_Undelegate(gen); - gen->is_running = 0; - goto throw_here; - } - if (likely(args)) { - ret = __Pyx_PyObject_Call(meth, args, NULL); - } else { - PyObject *cargs[4] = {NULL, typ, val, tb}; - ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); - } - Py_DECREF(meth); - } - gen->is_running = 0; - Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_MethodReturn(self, ret); - } -throw_here: - __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); -} -static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { - PyObject *typ; - PyObject *val = NULL; - PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) - return NULL; - return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); -} -static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { -#if PY_VERSION_HEX >= 0x030B00a4 - Py_VISIT(exc_state->exc_value); -#else - Py_VISIT(exc_state->exc_type); - Py_VISIT(exc_state->exc_value); - Py_VISIT(exc_state->exc_traceback); -#endif - return 0; -} -static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { - Py_VISIT(gen->closure); - Py_VISIT(gen->classobj); - Py_VISIT(gen->yieldfrom); - return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); -} -static int __Pyx_Coroutine_clear(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - Py_CLEAR(gen->closure); - Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); - __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); -#ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(self)) { - Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); - } -#endif - Py_CLEAR(gen->gi_code); - Py_CLEAR(gen->gi_frame); - Py_CLEAR(gen->gi_name); - Py_CLEAR(gen->gi_qualname); - Py_CLEAR(gen->gi_modulename); - return 0; -} -static void __Pyx_Coroutine_dealloc(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject_GC_UnTrack(gen); - if (gen->gi_weakreflist != NULL) - PyObject_ClearWeakRefs(self); - if (gen->resume_label >= 0) { - PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE - if (unlikely(PyObject_CallFinalizerFromDealloc(self))) -#else - Py_TYPE(gen)->tp_del(self); - if (unlikely(Py_REFCNT(self) > 0)) -#endif - { - return; - } - PyObject_GC_UnTrack(self); - } -#ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(self)) { - /* We have to handle this case for asynchronous generators - right here, because this code has to be between UNTRACK - and GC_Del. */ - Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); - } -#endif - __Pyx_Coroutine_clear(self); - __Pyx_PyHeapTypeObject_GC_Del(gen); -} -static void __Pyx_Coroutine_del(PyObject *self) { - PyObject *error_type, *error_value, *error_traceback; - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - __Pyx_PyThreadState_declare - if (gen->resume_label < 0) { - return; - } -#if !CYTHON_USE_TP_FINALIZE - assert(self->ob_refcnt == 0); - __Pyx_SET_REFCNT(self, 1); -#endif - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); -#ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(self)) { - __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; - PyObject *finalizer = agen->ag_finalizer; - if (finalizer && !agen->ag_closed) { - PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); - if (unlikely(!res)) { - PyErr_WriteUnraisable(self); - } else { - Py_DECREF(res); - } - __Pyx_ErrRestore(error_type, error_value, error_traceback); - return; - } - } -#endif - if (unlikely(gen->resume_label == 0 && !error_value)) { -#ifdef __Pyx_Coroutine_USED -#ifdef __Pyx_Generator_USED - if (!__Pyx_Generator_CheckExact(self)) -#endif - { - PyObject_GC_UnTrack(self); -#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) - if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) - PyErr_WriteUnraisable(self); -#else - {PyObject *msg; - char *cmsg; - #if CYTHON_COMPILING_IN_PYPY - msg = NULL; - cmsg = (char*) "coroutine was never awaited"; - #else - char *cname; - PyObject *qualname; - qualname = gen->gi_qualname; - cname = PyString_AS_STRING(qualname); - msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); - if (unlikely(!msg)) { - PyErr_Clear(); - cmsg = (char*) "coroutine was never awaited"; - } else { - cmsg = PyString_AS_STRING(msg); - } - #endif - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) - PyErr_WriteUnraisable(self); - Py_XDECREF(msg);} -#endif - PyObject_GC_Track(self); - } -#endif - } else { - PyObject *res = __Pyx_Coroutine_Close(self); - if (unlikely(!res)) { - if (PyErr_Occurred()) - PyErr_WriteUnraisable(self); - } else { - Py_DECREF(res); - } - } - __Pyx_ErrRestore(error_type, error_value, error_traceback); -#if !CYTHON_USE_TP_FINALIZE - assert(Py_REFCNT(self) > 0); - if (likely(--self->ob_refcnt == 0)) { - return; - } - { - Py_ssize_t refcnt = Py_REFCNT(self); - _Py_NewReference(self); - __Pyx_SET_REFCNT(self, refcnt); - } -#if CYTHON_COMPILING_IN_CPYTHON - assert(PyType_IS_GC(Py_TYPE(self)) && - _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); - _Py_DEC_REFTOTAL; -#endif -#ifdef COUNT_ALLOCS - --Py_TYPE(self)->tp_frees; - --Py_TYPE(self)->tp_allocs; -#endif -#endif -} -static PyObject * -__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) -{ - PyObject *name = self->gi_name; - CYTHON_UNUSED_VAR(context); - if (unlikely(!name)) name = Py_None; - Py_INCREF(name); - return name; -} -static int -__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(self->gi_name, value); - return 0; -} -static PyObject * -__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) -{ - PyObject *name = self->gi_qualname; - CYTHON_UNUSED_VAR(context); - if (unlikely(!name)) name = Py_None; - Py_INCREF(name); - return name; -} -static int -__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(self->gi_qualname, value); - return 0; -} -static PyObject * -__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) -{ - PyObject *frame = self->gi_frame; - CYTHON_UNUSED_VAR(context); - if (!frame) { - if (unlikely(!self->gi_code)) { - Py_RETURN_NONE; - } - frame = (PyObject *) PyFrame_New( - PyThreadState_Get(), /*PyThreadState *tstate,*/ - (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (unlikely(!frame)) - return NULL; - self->gi_frame = frame; - } - Py_INCREF(frame); - return frame; -} -static __pyx_CoroutineObject *__Pyx__Coroutine_New( - PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name) { - __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); - if (unlikely(!gen)) - return NULL; - return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); -} -static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( - __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name) { - gen->body = body; - gen->closure = closure; - Py_XINCREF(closure); - gen->is_running = 0; - gen->resume_label = 0; - gen->classobj = NULL; - gen->yieldfrom = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 - gen->gi_exc_state.exc_value = NULL; - #else - gen->gi_exc_state.exc_type = NULL; - gen->gi_exc_state.exc_value = NULL; - gen->gi_exc_state.exc_traceback = NULL; - #endif -#if CYTHON_USE_EXC_INFO_STACK - gen->gi_exc_state.previous_item = NULL; -#endif - gen->gi_weakreflist = NULL; - Py_XINCREF(qualname); - gen->gi_qualname = qualname; - Py_XINCREF(name); - gen->gi_name = name; - Py_XINCREF(module_name); - gen->gi_modulename = module_name; - Py_XINCREF(code); - gen->gi_code = code; - gen->gi_frame = NULL; - PyObject_GC_Track(gen); - return gen; -} - -/* PatchModuleWithCoroutine */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; -} - -/* PatchGeneratorABC */ -#ifndef CYTHON_REGISTER_ABCS -#define CYTHON_REGISTER_ABCS 1 -#endif -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; -} -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (CYTHON_REGISTER_ABCS && !abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); - if (unlikely(!module)) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_MAJOR_VERSION >= 3) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } - } -#else - if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; -} - -/* Generator */ -static PyMethodDef __pyx_Generator_methods[] = { - {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, - {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, - {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, - {0, 0, 0, 0} -}; -static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, -#if CYTHON_USE_TYPE_SPECS - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, -#endif - {0, 0, 0, 0, 0} -}; -static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - (char*) PyDoc_STR("Frame of the generator"), 0}, - {0, 0, 0, 0, 0} -}; -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_GeneratorType_slots[] = { - {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, - {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, - {Py_tp_iter, (void *)PyObject_SelfIter}, - {Py_tp_iternext, (void *)__Pyx_Generator_Next}, - {Py_tp_methods, (void *)__pyx_Generator_methods}, - {Py_tp_members, (void *)__pyx_Generator_memberlist}, - {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, -#if CYTHON_USE_TP_FINALIZE - {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, -#endif - {0, 0}, -}; -static PyType_Spec __pyx_GeneratorType_spec = { - __PYX_TYPE_MODULE_PREFIX "generator", - sizeof(__pyx_CoroutineObject), - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - __pyx_GeneratorType_slots -}; -#else -static PyTypeObject __pyx_GeneratorType_type = { - PyVarObject_HEAD_INIT(0, 0) - __PYX_TYPE_MODULE_PREFIX "generator", - sizeof(__pyx_CoroutineObject), - 0, - (destructor) __Pyx_Coroutine_dealloc, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, - 0, - (traverseproc) __Pyx_Coroutine_traverse, - 0, - 0, - offsetof(__pyx_CoroutineObject, gi_weakreflist), - 0, - (iternextfunc) __Pyx_Generator_Next, - __pyx_Generator_methods, - __pyx_Generator_memberlist, - __pyx_Generator_getsets, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, -#if CYTHON_USE_TP_FINALIZE - 0, -#else - __Pyx_Coroutine_del, -#endif - 0, -#if CYTHON_USE_TP_FINALIZE - __Pyx_Coroutine_del, -#elif PY_VERSION_HEX >= 0x030400a1 - 0, -#endif -#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, -#endif -#if __PYX_NEED_TP_PRINT_SLOT - 0, -#endif -#if PY_VERSION_HEX >= 0x030C0000 - 0, -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, -#endif -}; -#endif -static int __pyx_Generator_init(PyObject *module) { -#if CYTHON_USE_TYPE_SPECS - __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); -#else - CYTHON_UNUSED_VAR(module); - __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; - __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); -#endif - if (unlikely(!__pyx_GeneratorType)) { - return -1; - } - return 0; -} - -/* CheckBinaryVersion */ -static int __Pyx_check_binary_version(void) { - char ctversion[5]; - int same=1, i, found_dot; - const char* rt_from_call = Py_GetVersion(); - PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - found_dot = 0; - for (i = 0; i < 4; i++) { - if (!ctversion[i]) { - same = (rt_from_call[i] < '0' || rt_from_call[i] > '9'); - break; - } - if (rt_from_call[i] != ctversion[i]) { - same = 0; - break; - } - } - if (!same) { - char rtversion[5] = {'\0'}; - char message[200]; - for (i=0; i<4; ++i) { - if (rt_from_call[i] == '.') { - if (found_dot) break; - found_dot = 1; - } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { - break; - } - rtversion[i] = rt_from_call[i]; - } - PyOS_snprintf(message, sizeof(message), - "compile time version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction_3_0_0 -#define __PYX_HAVE_RT_ImportFunction_3_0_0 -static int __Pyx_ImportFunction_3_0_0(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); - if (!d) - goto bad; - cobj = PyDict_GetItemString(d, funcname); - if (!cobj) { - PyErr_Format(PyExc_ImportError, - "%.200s does not export expected C function %.200s", - PyModule_GetName(module), funcname); - goto bad; - } - if (!PyCapsule_IsValid(cobj, sig)) { - PyErr_Format(PyExc_TypeError, - "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", - PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); - goto bad; - } - tmp.p = PyCapsule_GetPointer(cobj, sig); - *f = tmp.fp; - if (!(*f)) - goto bad; - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(d); - return -1; -} -#endif - -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); - } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); - } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); - } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} -#endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - if (!*t->p) - return -1; - if (PyObject_Hash(*t->p) == -1) - return -1; - #endif - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} -#else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (likely(PyUnicode_IS_ASCII(o))) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -} -#endif -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { - return __Pyx_PyUnicode_AsStringAndSize(o, length); - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { - int retval; - if (unlikely(!x)) return -1; - retval = __Pyx_PyObject_IsTrue(x); - Py_DECREF(x); - return retval; -} -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 - if (PyLong_Check(result)) { - if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, - "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " - "The ability to return an instance of a strict subclass of int is deprecated, " - "and may be removed in a future version of Python.", - result_type_name)) { - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; - } - __Pyx_DECREF_TypeName(result_type_name); - return result; - } -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { -#if CYTHON_USE_TYPE_SLOTS - PyNumberMethods *m; -#endif - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else - if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); -#if CYTHON_USE_TYPE_SLOTS - m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else - if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); - } - #endif -#else - if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); - } -#endif - if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(__Pyx_PyLong_IsCompact(b))) { - return __Pyx_PyLong_CompactValue(b); - } else { - const digit* digits = __Pyx_PyLong_Digits(b); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { - if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { - return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif - } else { - Py_ssize_t ival; - PyObject *x; - x = PyNumber_Index(o); - if (!x) return -1; - ival = PyInt_AsLong(x); - Py_DECREF(x); - return ival; - } -} -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -/* #### Code section: utility_code_pragmas_end ### */ -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - - - -/* #### Code section: end ### */ -#endif /* Py_PYTHON_H */ diff --git a/taos/_parser.cpp b/taos/_parser.cpp deleted file mode 100644 index 58fb6251..00000000 --- a/taos/_parser.cpp +++ /dev/null @@ -1,7259 +0,0 @@ -/* Generated by Cython 3.0.0 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "language": "c++", - "name": "taos._parser", - "sources": [ - "taos/_parser.pyx" - ] - }, - "module_name": "taos._parser" -} -END: Cython Metadata */ - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif -#endif - -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#define CYTHON_ABI "3_0_0" -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030000F0 -#define CYTHON_FUTURE_DIVISION 1 -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#if defined(GRAALVM_PYTHON) - /* For very preliminary testing purposes. Most variables are set the same as PyPy. - The existence of this section does not imply that anything works or is even tested */ - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PYPY_VERSION) - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) - #endif - #if PY_VERSION_HEX < 0x03090000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(CYTHON_LIMITED_API) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 1 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 1 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #endif - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif -#elif defined(PY_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #ifndef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 1 - #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 1 - #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 1 - #endif - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #elif !defined(CYTHON_USE_UNICODE_WRITER) - #define CYTHON_USE_UNICODE_WRITER 1 - #endif - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #ifndef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 1 - #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) - #endif - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) - #endif - #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 1 - #endif - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #if PY_VERSION_HEX < 0x030600B1 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) - #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) - #define CYTHON_USE_EXC_INFO_STACK 1 - #endif - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif -#endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) -#endif -#if !defined(CYTHON_VECTORCALL) -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) -#endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif - #undef SHIFT - #undef BASE - #undef MASK - #ifdef SIZEOF_VOID_P - enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; - #endif -#endif -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif -#ifndef __has_cpp_attribute - #define __has_cpp_attribute(x) 0 -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifndef CYTHON_UNUSED - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(maybe_unused) - #define CYTHON_UNUSED [[maybe_unused]] - #endif - #endif - #endif -#endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_UNUSED_VAR -# if defined(__cplusplus) - template void CYTHON_UNUSED_VAR( const T& ) { } -# else -# define CYTHON_UNUSED_VAR(x) (void)(x) -# endif -#endif -#ifndef CYTHON_MAYBE_UNUSED_VAR - #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif -#ifndef CYTHON_FALLTHROUGH - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(fallthrough) - #define CYTHON_FALLTHROUGH [[fallthrough]] - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_cpp_attribute(clang::fallthrough) - #define CYTHON_FALLTHROUGH [[clang::fallthrough]] - #elif __has_cpp_attribute(gnu::fallthrough) - #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] - #endif - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_attribute(fallthrough) - #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) - #else - #define CYTHON_FALLTHROUGH - #endif - #endif - #if defined(__clang__) && defined(__apple_build_version__) - #if __apple_build_version__ < 7000000 - #undef CYTHON_FALLTHROUGH - #define CYTHON_FALLTHROUGH - #endif - #endif -#endif -#ifdef __cplusplus - template - struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; - #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) -#else - #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) -#endif -#if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) -#else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) -#endif -#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) - -#ifndef __cplusplus - #error "Cython files generated with the C++ option must be compiled with a C++ compiler." -#endif -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #else - #define CYTHON_INLINE inline - #endif -#endif -template -void __Pyx_call_destructor(T& x) { - x.~T(); -} -template -class __Pyx_FakeReference { - public: - __Pyx_FakeReference() : ptr(NULL) { } - __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } - T *operator->() { return ptr; } - T *operator&() { return ptr; } - operator T&() { return *ptr; } - template bool operator ==(const U& other) const { return *ptr == other; } - template bool operator !=(const U& other) const { return *ptr != other; } - template bool operator==(const __Pyx_FakeReference& other) const { return *ptr == *other.ptr; } - template bool operator!=(const __Pyx_FakeReference& other) const { return *ptr != *other.ptr; } - private: - T *ptr; -}; - -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type -#if PY_VERSION_HEX >= 0x030B00A1 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; - PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *empty=NULL; - const char *fn_cstr=NULL; - const char *name_cstr=NULL; - PyCodeObject *co=NULL, *result=NULL; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - if (!(kwds=PyDict_New())) goto end; - if (!(argcount=PyLong_FromLong(a))) goto end; - if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; - if (!(posonlyargcount=PyLong_FromLong(p))) goto end; - if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; - if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; - if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; - if (!(nlocals=PyLong_FromLong(l))) goto end; - if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; - if (!(stacksize=PyLong_FromLong(s))) goto end; - if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; - if (!(flags=PyLong_FromLong(f))) goto end; - if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; - if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; - if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; - if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; - if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto end; - if (!(empty = PyTuple_New(0))) goto end; - result = (PyCodeObject*) PyObject_Call(replace, empty, kwds); - end: - Py_XDECREF((PyObject*) co); - Py_XDECREF(kwds); - Py_XDECREF(argcount); - Py_XDECREF(posonlyargcount); - Py_XDECREF(kwonlyargcount); - Py_XDECREF(nlocals); - Py_XDECREF(stacksize); - Py_XDECREF(replace); - Py_XDECREF(empty); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#endif -#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) - #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) -#else - #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) - #define __Pyx_Py_Is(x, y) Py_Is(x, y) -#else - #define __Pyx_Py_Is(x, y) ((x) == (y)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) - #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) -#else - #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) - #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) -#else - #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) - #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) -#else - #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) -#endif -#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) -#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) -#else - #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) -#endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#ifndef Py_TPFLAGS_SEQUENCE - #define Py_TPFLAGS_SEQUENCE 0 -#endif -#ifndef Py_TPFLAGS_MAPPING - #define Py_TPFLAGS_MAPPING 0 -#endif -#ifndef METH_STACKLESS - #define METH_STACKLESS 0 -#endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) - #ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - #endif - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); - typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, - Py_ssize_t nargs, PyObject *kwnames); -#else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords -#endif -#if CYTHON_METH_FASTCALL - #define __Pyx_METH_FASTCALL METH_FASTCALL - #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast - #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords -#else - #define __Pyx_METH_FASTCALL METH_VARARGS - #define __Pyx_PyCFunction_FastCall PyCFunction - #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords -#endif -#if CYTHON_VECTORCALL - #define __pyx_vectorcallfunc vectorcallfunc - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET - #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) -#else - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) -#endif -#if PY_VERSION_HEX < 0x030900B1 - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) - typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); -#else - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) - #define __Pyx_PyCMethod PyCMethod -#endif -#ifndef METH_METHOD - #define METH_METHOD 0x200 -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyThreadState_Current PyThreadState_Get() -#elif !CYTHON_FAST_THREAD_STATE - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#else - #define __Pyx_PyThreadState_Current _PyThreadState_Current -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) -{ - void *result; - result = PyModule_GetState(op); - if (!result) - Py_FatalError("Couldn't find the module state"); - return result; -} -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) -#else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif -#endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) -#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) -#else -#define __Pyx_PyDict_NewPresized(n) PyDict_New() -#endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS -#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { - PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); - if (res == NULL) PyErr_Clear(); - return res; -} -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) -#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#else -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { -#if CYTHON_COMPILING_IN_PYPY - return PyDict_GetItem(dict, name); -#else - PyDictEntry *ep; - PyDictObject *mp = (PyDictObject*) dict; - long hash = ((PyStringObject *) name)->ob_shash; - assert(hash != -1); - ep = (mp->ma_lookup)(mp, name, hash); - if (ep == NULL) { - return NULL; - } - return ep->me_value; -#endif -} -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#endif -#if CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) - #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) -#else - #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) - #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 -#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ - assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ - PyObject_GC_Del(obj);\ - Py_DECREF(type);\ -} -#else -#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) - #define __Pyx_PyUnicode_DATA(u) ((void*)u) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_READY(op) (0) - #else - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) - #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) - #else - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #if !defined(PyUnicode_DecodeUnicodeEscape) - #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) - #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) - #endif - #if !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) - #endif - #if !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) - #endif -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#if CYTHON_COMPILING_IN_CPYTHON - #define __Pyx_PySequence_ListKeepNew(obj)\ - (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) -#else - #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) -#endif -#if PY_VERSION_HEX >= 0x030900A4 - #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) -#else - #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) -#endif -#if CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) -#else - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif -#else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef __Pyx_PyAsyncMethodsStruct - typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; - } __Pyx_PyAsyncMethodsStruct; -#endif - -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } -#define __PYX_ERR(f_index, lineno, Ln_error) \ - { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } - -#ifdef CYTHON_EXTERN_C - #undef __PYX_EXTERN_C - #define __PYX_EXTERN_C CYTHON_EXTERN_C -#elif defined(__PYX_EXTERN_C) - #ifdef _MSC_VER - #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") - #else - #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. - #endif -#else - #define __PYX_EXTERN_C extern "C++" -#endif - -#define __PYX_HAVE__taos___parser -#define __PYX_HAVE_API__taos___parser -/* Early includes */ -#include -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { - return (size_t) i < (size_t) limit; -} -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) - #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif -#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -#define __Pyx_PySequence_Tuple(obj)\ - (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); -#if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_VERSION_HEX >= 0x030C00A7 - #ifndef _PyLong_SIGN_MASK - #define _PyLong_SIGN_MASK 3 - #endif - #ifndef _PyLong_NON_SIZE_BITS - #define _PyLong_NON_SIZE_BITS 3 - #endif - #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) - #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) - #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) - #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) - #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_SignedDigitCount(x)\ - ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) - #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) - #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) - #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) - #else - #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) - #endif - typedef Py_ssize_t __Pyx_compact_pylong; - typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 - #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) - #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) - #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) - #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) - #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) - #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) - #define __Pyx_PyLong_CompactValue(x)\ - ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) - typedef sdigit __Pyx_compact_pylong; - typedef digit __Pyx_compact_upylong; - #endif - #if PY_VERSION_HEX >= 0x030C00A5 - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) - #else - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) - #endif -#endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ -static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } - -#if !CYTHON_USE_MODULE_STATE -static PyObject *__pyx_m = NULL; -#endif -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; -static const char *__pyx_filename; - -/* #### Code section: filename_table ### */ - -static const char *__pyx_f[] = { - "taos\\\\_parser.pyx", -}; -/* #### Code section: utility_code_proto_before_types ### */ -/* #### Code section: numeric_typedefs ### */ -/* #### Code section: complex_type_declarations ### */ -/* #### Code section: type_declarations ### */ - -/*--- Type declarations ---*/ -/* #### Code section: utility_code_proto ### */ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, Py_ssize_t); - void (*DECREF)(void*, PyObject*, Py_ssize_t); - void (*GOTREF)(void*, PyObject*, Py_ssize_t); - void (*GIVEREF)(void*, PyObject*, Py_ssize_t); - void* (*SetupContext)(const char*, Py_ssize_t, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - } - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContextNogil() - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_Py_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; Py_XDECREF(tmp);\ - } while (0) -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; -#if PY_VERSION_HEX >= 0x030C00A6 -#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) -#else -#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) -#endif -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) -#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 -#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) -#else -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#endif -#else -#define __Pyx_PyErr_Clear() PyErr_Clear() -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* PyObjectGetAttrStrNoError.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* IncludeStringH.proto */ -#include - -/* decode_c_string_utf16.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { - int byteorder = 0; - return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); -} -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { - int byteorder = -1; - return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); -} -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { - int byteorder = 1; - return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); -} - -/* decode_c_string.proto */ -static CYTHON_INLINE PyObject* __Pyx_decode_c_string( - const char* cstring, Py_ssize_t start, Py_ssize_t stop, - const char* encoding, const char* errors, - PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); - -/* ListAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -/* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -/* PyDictVersioning.proto */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif - -/* GetModuleGlobalName.proto */ -#if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) do {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ - (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ - __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ - PY_UINT64_T __pyx_dict_version;\ - PyObject *__pyx_dict_cached_value;\ - (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); -#else -#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) -#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif - -/* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); -#endif - -/* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* GCCDiagnostics.proto */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define __Pyx_HAS_GCC_DIAGNOSTIC -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); - -/* FormatTypeName.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -typedef PyObject *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); -#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) -#else -typedef const char *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) -#define __Pyx_DECREF_TypeName(obj) -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* FastTypeChecks.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); -#else -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) -#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) -#endif -#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* FunctionExport.proto */ -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - -/* #### Code section: module_declarations ### */ - -/* Module declarations from "libc.stdint" */ - -/* Module declarations from "libcpp" */ - -/* Module declarations from "taos._parser" */ -/* #### Code section: typeinfo ### */ -/* #### Code section: before_global_var ### */ -#define __Pyx_MODULE_NAME "taos._parser" -extern int __pyx_module_is_main_taos___parser; -int __pyx_module_is_main_taos___parser = 0; - -/* Implementation of "taos._parser" */ -/* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_range; -/* #### Code section: string_decls ### */ -static const char __pyx_k_[] = "*"; -static const char __pyx_k__2[] = "?"; -static const char __pyx_k_dt[] = "dt"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_seconds[] = "seconds"; -static const char __pyx_k_datetime[] = "datetime"; -static const char __pyx_k_timedelta[] = "timedelta"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -/* #### Code section: decls ### */ -/* #### Code section: late_includes ### */ -/* #### Code section: module_state ### */ -typedef struct { - PyObject *__pyx_d; - PyObject *__pyx_b; - PyObject *__pyx_cython_runtime; - PyObject *__pyx_empty_tuple; - PyObject *__pyx_empty_bytes; - PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_n_s_; - PyObject *__pyx_n_s__2; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_datetime; - PyObject *__pyx_n_s_dt; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_seconds; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_timedelta; -} __pyx_mstate; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { - extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstate __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - Py_CLEAR(clear_module_state->__pyx_n_s_); - Py_CLEAR(clear_module_state->__pyx_n_s__2); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_datetime); - Py_CLEAR(clear_module_state->__pyx_n_s_dt); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_seconds); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_timedelta); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif - Py_VISIT(traverse_module_state->__pyx_n_s_); - Py_VISIT(traverse_module_state->__pyx_n_s__2); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_datetime); - Py_VISIT(traverse_module_state->__pyx_n_s_dt); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_seconds); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_timedelta); - return 0; -} -#endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ -#define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime -#define __pyx_n_s_dt __pyx_mstate_global->__pyx_n_s_dt -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_seconds __pyx_mstate_global->__pyx_n_s_seconds -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_timedelta __pyx_mstate_global->__pyx_n_s_timedelta -/* #### Code section: module_code ### */ - -/* "taos/_parser.pyx":3 - * import datetime as dt - * - * cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_binary_string(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, int __pyx_v_field_length) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - size_t __pyx_v_nchar_ptr; - PyObject *__pyx_v_py_string = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - char *__pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_binary_string", 0); - - /* "taos/_parser.pyx":4 - * - * cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * for i in range(abs(num_of_rows)): - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":6 - * cdef list res = [] - * cdef int i - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * nchar_ptr = ptr + field_length * i - * py_string = (nchar_ptr).decode("utf-8") - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 6, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":7 - * cdef int i - * for i in range(abs(num_of_rows)): - * nchar_ptr = ptr + field_length * i # <<<<<<<<<<<<<< - * py_string = (nchar_ptr).decode("utf-8") - * res.append(py_string) - */ - __pyx_v_nchar_ptr = (__pyx_v_ptr + (__pyx_v_field_length * __pyx_v_i)); - - /* "taos/_parser.pyx":8 - * for i in range(abs(num_of_rows)): - * nchar_ptr = ptr + field_length * i - * py_string = (nchar_ptr).decode("utf-8") # <<<<<<<<<<<<<< - * res.append(py_string) - * - */ - __pyx_t_5 = ((char *)__pyx_v_nchar_ptr); - __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_5, 0, strlen(__pyx_t_5), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_py_string, __pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "taos/_parser.pyx":9 - * nchar_ptr = ptr + field_length * i - * py_string = (nchar_ptr).decode("utf-8") - * res.append(py_string) # <<<<<<<<<<<<<< - * - * return res - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_py_string); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 9, __pyx_L1_error) - } - - /* "taos/_parser.pyx":11 - * res.append(py_string) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":3 - * import datetime as dt - * - * cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_binary_string", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XDECREF(__pyx_v_py_string); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":13 - * return res - * - * cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_nchar_string(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, int __pyx_v_field_length) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - size_t __pyx_v_c_char_ptr; - PyObject *__pyx_v_py_string = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_nchar_string", 0); - - /* "taos/_parser.pyx":14 - * - * cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * for i in range(abs(num_of_rows)): - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":16 - * cdef list res = [] - * cdef int i - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * c_char_ptr = ptr + field_length * i - * py_string = (c_char_ptr)[:field_length].decode("utf-8") - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 16, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":17 - * cdef int i - * for i in range(abs(num_of_rows)): - * c_char_ptr = ptr + field_length * i # <<<<<<<<<<<<<< - * py_string = (c_char_ptr)[:field_length].decode("utf-8") - * res.append(py_string) - */ - __pyx_v_c_char_ptr = (__pyx_v_ptr + (__pyx_v_field_length * __pyx_v_i)); - - /* "taos/_parser.pyx":18 - * for i in range(abs(num_of_rows)): - * c_char_ptr = ptr + field_length * i - * py_string = (c_char_ptr)[:field_length].decode("utf-8") # <<<<<<<<<<<<<< - * res.append(py_string) - * - */ - __pyx_t_1 = __Pyx_decode_c_string(((char *)__pyx_v_c_char_ptr), 0, __pyx_v_field_length, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_py_string, __pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":19 - * c_char_ptr = ptr + field_length * i - * py_string = (c_char_ptr)[:field_length].decode("utf-8") - * res.append(py_string) # <<<<<<<<<<<<<< - * - * return res - */ - __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_py_string); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 19, __pyx_L1_error) - } - - /* "taos/_parser.pyx":21 - * res.append(py_string) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":13 - * return res - * - * cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_nchar_string", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XDECREF(__pyx_v_py_string); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":23 - * return res - * - * cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_string(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, int *__pyx_v_offsets) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - size_t __pyx_v_rbyte_ptr; - size_t __pyx_v_c_char_ptr; - uint16_t __pyx_v_rbyte; - PyObject *__pyx_v_py_string = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_string", 0); - - /* "taos/_parser.pyx":24 - * - * cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * cdef size_t rbyte_ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":28 - * cdef size_t rbyte_ptr - * cdef size_t c_char_ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if offsets[i] == -1: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 28, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":29 - * cdef size_t c_char_ptr - * for i in range(abs(num_of_rows)): - * if offsets[i] == -1: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - __pyx_t_5 = ((__pyx_v_offsets[__pyx_v_i]) == -1L); - if (__pyx_t_5) { - - /* "taos/_parser.pyx":30 - * for i in range(abs(num_of_rows)): - * if offsets[i] == -1: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * rbyte_ptr = ptr + offsets[i] - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 30, __pyx_L1_error) - - /* "taos/_parser.pyx":29 - * cdef size_t c_char_ptr - * for i in range(abs(num_of_rows)): - * if offsets[i] == -1: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":32 - * res.append(None) - * else: - * rbyte_ptr = ptr + offsets[i] # <<<<<<<<<<<<<< - * rbyte = (rbyte_ptr)[0] - * c_char_ptr = rbyte_ptr + sizeof(uint16_t) - */ - /*else*/ { - __pyx_v_rbyte_ptr = (__pyx_v_ptr + (__pyx_v_offsets[__pyx_v_i])); - - /* "taos/_parser.pyx":33 - * else: - * rbyte_ptr = ptr + offsets[i] - * rbyte = (rbyte_ptr)[0] # <<<<<<<<<<<<<< - * c_char_ptr = rbyte_ptr + sizeof(uint16_t) - * py_string = (c_char_ptr)[:rbyte].decode("utf-8") - */ - __pyx_v_rbyte = (((uint16_t *)__pyx_v_rbyte_ptr)[0]); - - /* "taos/_parser.pyx":34 - * rbyte_ptr = ptr + offsets[i] - * rbyte = (rbyte_ptr)[0] - * c_char_ptr = rbyte_ptr + sizeof(uint16_t) # <<<<<<<<<<<<<< - * py_string = (c_char_ptr)[:rbyte].decode("utf-8") - * res.append(py_string) - */ - __pyx_v_c_char_ptr = (__pyx_v_rbyte_ptr + (sizeof(uint16_t))); - - /* "taos/_parser.pyx":35 - * rbyte = (rbyte_ptr)[0] - * c_char_ptr = rbyte_ptr + sizeof(uint16_t) - * py_string = (c_char_ptr)[:rbyte].decode("utf-8") # <<<<<<<<<<<<<< - * res.append(py_string) - * - */ - __pyx_t_1 = __Pyx_decode_c_string(((char *)__pyx_v_c_char_ptr), 0, __pyx_v_rbyte, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_py_string, __pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":36 - * c_char_ptr = rbyte_ptr + sizeof(uint16_t) - * py_string = (c_char_ptr)[:rbyte].decode("utf-8") - * res.append(py_string) # <<<<<<<<<<<<<< - * - * return res - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_py_string); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 36, __pyx_L1_error) - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":38 - * res.append(py_string) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":23 - * return res - * - * cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_string", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XDECREF(__pyx_v_py_string); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":40 - * return res - * - * cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_bool(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - bool *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_bool", 0); - - /* "taos/_parser.pyx":41 - * - * cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":43 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((bool *)__pyx_v_ptr); - - /* "taos/_parser.pyx":44 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 44, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":45 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 45, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":46 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 46, __pyx_L1_error) - - /* "taos/_parser.pyx":45 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":48 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":50 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":40 - * return res - * - * cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":52 - * return res - * - * cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_int8_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - int8_t *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_int8_t", 0); - - /* "taos/_parser.pyx":53 - * - * cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":55 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((int8_t *)__pyx_v_ptr); - - /* "taos/_parser.pyx":56 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 56, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":57 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 57, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":58 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 58, __pyx_L1_error) - - /* "taos/_parser.pyx":57 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":60 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_int8_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 60, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":62 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":52 - * return res - * - * cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":64 - * return res - * - * cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_int16_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - int16_t *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_int16_t", 0); - - /* "taos/_parser.pyx":65 - * - * cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":67 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((int16_t *)__pyx_v_ptr); - - /* "taos/_parser.pyx":68 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 68, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":69 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 69, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":70 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 70, __pyx_L1_error) - - /* "taos/_parser.pyx":69 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":72 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_int16_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":74 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":64 - * return res - * - * cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":76 - * return res - * - * cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_int32_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - int32_t *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_int32_t", 0); - - /* "taos/_parser.pyx":77 - * - * cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":79 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((int32_t *)__pyx_v_ptr); - - /* "taos/_parser.pyx":80 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":81 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 81, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":82 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 82, __pyx_L1_error) - - /* "taos/_parser.pyx":81 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":84 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_int32_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":86 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":76 - * return res - * - * cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":88 - * return res - * - * cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_int64_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - int64_t *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_int64_t", 0); - - /* "taos/_parser.pyx":89 - * - * cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":91 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((int64_t *)__pyx_v_ptr); - - /* "taos/_parser.pyx":92 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 92, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":93 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 93, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 93, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":94 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 94, __pyx_L1_error) - - /* "taos/_parser.pyx":93 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":96 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_int64_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":98 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":88 - * return res - * - * cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":100 - * return res - * - * cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_uint8_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - uint8_t *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_uint8_t", 0); - - /* "taos/_parser.pyx":101 - * - * cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":103 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((uint8_t *)__pyx_v_ptr); - - /* "taos/_parser.pyx":104 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 104, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":105 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 105, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":106 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 106, __pyx_L1_error) - - /* "taos/_parser.pyx":105 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":108 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_uint8_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 108, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":110 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":100 - * return res - * - * cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":112 - * return res - * - * cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_uint16_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - uint16_t *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_uint16_t", 0); - - /* "taos/_parser.pyx":113 - * - * cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":115 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((uint16_t *)__pyx_v_ptr); - - /* "taos/_parser.pyx":116 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":117 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 117, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":118 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 118, __pyx_L1_error) - - /* "taos/_parser.pyx":117 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":120 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_uint16_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 120, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":122 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":112 - * return res - * - * cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":124 - * return res - * - * cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_uint32_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - uint32_t *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_uint32_t", 0); - - /* "taos/_parser.pyx":125 - * - * cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":127 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((uint32_t *)__pyx_v_ptr); - - /* "taos/_parser.pyx":128 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 128, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":129 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 129, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":130 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 130, __pyx_L1_error) - - /* "taos/_parser.pyx":129 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":132 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_uint32_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":134 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":124 - * return res - * - * cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":136 - * return res - * - * cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_uint64_t(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - uint64_t *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_uint64_t", 0); - - /* "taos/_parser.pyx":137 - * - * cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":139 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((uint64_t *)__pyx_v_ptr); - - /* "taos/_parser.pyx":140 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 140, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":141 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 141, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":142 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 142, __pyx_L1_error) - - /* "taos/_parser.pyx":141 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":144 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_uint64_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":146 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":136 - * return res - * - * cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":148 - * return res - * - * cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_int(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - int *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_int", 0); - - /* "taos/_parser.pyx":149 - * - * cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":151 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((int *)__pyx_v_ptr); - - /* "taos/_parser.pyx":152 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 152, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":153 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 153, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":154 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 154, __pyx_L1_error) - - /* "taos/_parser.pyx":153 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":156 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 156, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":158 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":148 - * return res - * - * cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_int", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":160 - * return res - * - * cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_uint(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - unsigned int *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_uint", 0); - - /* "taos/_parser.pyx":161 - * - * cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":163 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((unsigned int *)__pyx_v_ptr); - - /* "taos/_parser.pyx":164 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 164, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":165 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 165, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":166 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 166, __pyx_L1_error) - - /* "taos/_parser.pyx":165 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":168 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_unsigned_int((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":170 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":160 - * return res - * - * cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_uint", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":172 - * return res - * - * cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_float(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - float *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_float", 0); - - /* "taos/_parser.pyx":173 - * - * cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":175 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((float *)__pyx_v_ptr); - - /* "taos/_parser.pyx":176 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":177 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 177, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":178 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 178, __pyx_L1_error) - - /* "taos/_parser.pyx":177 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":180 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 180, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":182 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":172 - * return res - * - * cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_float", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":184 - * return res - * - * cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_double(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - double *__pyx_v_v_ptr; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_double", 0); - - /* "taos/_parser.pyx":185 - * - * cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * v_ptr = ptr - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":187 - * cdef list res = [] - * cdef int i - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((double *)__pyx_v_ptr); - - /* "taos/_parser.pyx":188 - * cdef int i - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 188, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":189 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 189, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":190 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * res.append(v_ptr[i]) - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 190, __pyx_L1_error) - - /* "taos/_parser.pyx":189 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":192 - * res.append(None) - * else: - * res.append(v_ptr[i]) # <<<<<<<<<<<<<< - * - * return res - */ - /*else*/ { - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 192, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":194 - * res.append(v_ptr[i]) - * - * return res # <<<<<<<<<<<<<< - * - * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":184 - * return res - * - * cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("taos._parser._parse_double", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "taos/_parser.pyx":196 - * return res - * - * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - -static PyObject *__pyx_f_4taos_7_parser__parse_timestamp(size_t __pyx_v_ptr, int __pyx_v_num_of_rows, PyObject *__pyx_v_is_null, int __pyx_v_precision, PyObject *__pyx_v_dt_epoch) { - PyObject *__pyx_v_res = 0; - int __pyx_v_i; - double __pyx_v_denom; - int64_t *__pyx_v_v_ptr; - PyObject *__pyx_v_raw_value = NULL; - PyObject *__pyx_v__dt = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_parse_timestamp", 0); - - /* "taos/_parser.pyx":197 - * - * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): - * cdef list res = [] # <<<<<<<<<<<<<< - * cdef int i - * cdef double denom = 10**((precision + 1) * 3) - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_res = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":199 - * cdef list res = [] - * cdef int i - * cdef double denom = 10**((precision + 1) * 3) # <<<<<<<<<<<<<< - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - */ - __pyx_v_denom = pow(10.0, ((double)((__pyx_v_precision + 1) * 3))); - - /* "taos/_parser.pyx":200 - * cdef int i - * cdef double denom = 10**((precision + 1) * 3) - * v_ptr = ptr # <<<<<<<<<<<<<< - * for i in range(abs(num_of_rows)): - * if is_null[i]: - */ - __pyx_v_v_ptr = ((int64_t *)__pyx_v_ptr); - - /* "taos/_parser.pyx":201 - * cdef double denom = 10**((precision + 1) * 3) - * v_ptr = ptr - * for i in range(abs(num_of_rows)): # <<<<<<<<<<<<<< - * if is_null[i]: - * res.append(None) - */ - __pyx_t_2 = abs(__pyx_v_num_of_rows); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 201, __pyx_L1_error) - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "taos/_parser.pyx":202 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - if (unlikely(__pyx_v_is_null == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 202, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_is_null, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_5) { - - /* "taos/_parser.pyx":203 - * for i in range(abs(num_of_rows)): - * if is_null[i]: - * res.append(None) # <<<<<<<<<<<<<< - * else: - * raw_value = v_ptr[i] - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 203, __pyx_L1_error) - - /* "taos/_parser.pyx":202 - * v_ptr = ptr - * for i in range(abs(num_of_rows)): - * if is_null[i]: # <<<<<<<<<<<<<< - * res.append(None) - * else: - */ - goto __pyx_L5; - } - - /* "taos/_parser.pyx":205 - * res.append(None) - * else: - * raw_value = v_ptr[i] # <<<<<<<<<<<<<< - * if precision <= 1: - * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) - */ - /*else*/ { - __pyx_t_1 = __Pyx_PyInt_From_int64_t((__pyx_v_v_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_raw_value, __pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":206 - * else: - * raw_value = v_ptr[i] - * if precision <= 1: # <<<<<<<<<<<<<< - * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) - * else: - */ - __pyx_t_5 = (__pyx_v_precision <= 1); - if (__pyx_t_5) { - - /* "taos/_parser.pyx":207 - * raw_value = v_ptr[i] - * if precision <= 1: - * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) # <<<<<<<<<<<<<< - * else: - * _dt = raw_value - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_denom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_v_raw_value, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seconds, __pyx_t_9) < 0) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_v_dt_epoch, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF_SET(__pyx_v__dt, __pyx_t_1); - __pyx_t_1 = 0; - - /* "taos/_parser.pyx":206 - * else: - * raw_value = v_ptr[i] - * if precision <= 1: # <<<<<<<<<<<<<< - * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) - * else: - */ - goto __pyx_L6; - } - - /* "taos/_parser.pyx":209 - * _dt = dt_epoch + dt.timedelta(seconds=raw_value / denom) - * else: - * _dt = raw_value # <<<<<<<<<<<<<< - * res.append(_dt) - * return res - */ - /*else*/ { - __Pyx_INCREF(__pyx_v_raw_value); - __Pyx_XDECREF_SET(__pyx_v__dt, __pyx_v_raw_value); - } - __pyx_L6:; - - /* "taos/_parser.pyx":210 - * else: - * _dt = raw_value - * res.append(_dt) # <<<<<<<<<<<<<< - * return res - */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v__dt); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 210, __pyx_L1_error) - } - __pyx_L5:; - } - - /* "taos/_parser.pyx":211 - * _dt = raw_value - * res.append(_dt) - * return res # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_res); - __pyx_r = __pyx_v_res; - goto __pyx_L0; - - /* "taos/_parser.pyx":196 - * return res - * - * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("taos._parser._parse_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_res); - __Pyx_XDECREF(__pyx_v_raw_value); - __Pyx_XDECREF(__pyx_v__dt); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, - {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, - {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 6, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - __Pyx_RefNannyFinishContext(); - return 0; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - if (__Pyx_ExportFunction("_parse_binary_string", (void (*)(void))__pyx_f_4taos_7_parser__parse_binary_string, "PyObject *(size_t, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_nchar_string", (void (*)(void))__pyx_f_4taos_7_parser__parse_nchar_string, "PyObject *(size_t, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_string", (void (*)(void))__pyx_f_4taos_7_parser__parse_string, "PyObject *(size_t, int, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_bool", (void (*)(void))__pyx_f_4taos_7_parser__parse_bool, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_int8_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_int8_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_int16_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_int16_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_int32_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_int32_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_int64_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_int64_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_uint8_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint8_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_uint16_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint16_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_uint32_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint32_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_uint64_t", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint64_t, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_int", (void (*)(void))__pyx_f_4taos_7_parser__parse_int, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_uint", (void (*)(void))__pyx_f_4taos_7_parser__parse_uint, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_float", (void (*)(void))__pyx_f_4taos_7_parser__parse_float, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_double", (void (*)(void))__pyx_f_4taos_7_parser__parse_double, "PyObject *(size_t, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("_parse_timestamp", (void (*)(void))__pyx_f_4taos_7_parser__parse_timestamp, "PyObject *(size_t, int, PyObject *, int, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_type_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - - -#if PY_MAJOR_VERSION >= 3 -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec__parser(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec__parser}, - {0, NULL} -}; -#endif - -#ifdef __cplusplus -namespace { - struct PyModuleDef __pyx_moduledef = - #else - static struct PyModuleDef __pyx_moduledef = - #endif - { - PyModuleDef_HEAD_INIT, - "_parser", - 0, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ - #else - -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - #if CYTHON_USE_MODULE_STATE - __pyx_m_traverse, /* m_traverse */ - __pyx_m_clear, /* m_clear */ - NULL /* m_free */ - #else - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ - #endif - }; - #ifdef __cplusplus -} /* anonymous namespace */ -#endif -#endif - -#ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif -#endif - - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC init_parser(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC init_parser(void) -#else -__Pyx_PyMODINIT_FUNC PyInit__parser(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit__parser(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 - static PY_INT64_T main_interpreter_id = -1; - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; - } - return 0; -} -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) -#endif -{ - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else - result = PyDict_SetItemString(moddict, to_name, value); -#endif - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; - } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - CYTHON_UNUSED_VAR(def); - if (__Pyx_check_single_interpreter()) - return NULL; - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; -#endif - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} - - -static CYTHON_SMALL_CODE int __pyx_pymod_exec__parser(PyObject *__pyx_pyinit_module) -#endif -#endif -{ - int stringtab_initialized = 0; - #if CYTHON_USE_MODULE_STATE - int pystate_addmodule_run = 0; - #endif - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module '_parser' has already been imported. Re-initialisation is not supported."); - return -1; - } - #elif PY_MAJOR_VERSION >= 3 - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); - #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("_parser", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE - __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to _parser pseudovariable */ - if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - pystate_addmodule_run = 1; - } - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #endif - CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__parser(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_taos___parser) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "taos._parser")) { - if (unlikely((PyDict_SetItemString(modules, "taos._parser", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_init_code(); - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "taos/_parser.pyx":1 - * import datetime as dt # <<<<<<<<<<<<<< - * - * cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dt, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "taos/_parser.pyx":196 - * return res - * - * cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): # <<<<<<<<<<<<<< - * cdef list res = [] - * cdef int i - */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init taos._parser", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); - } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init taos._parser"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; - #else - return; - #endif -} -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#endif - - - -/* #### Code section: utility_code_def ### */ - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; -#endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); - #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#endif - -/* PyObjectGetAttrStrNoError */ -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } -#endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* decode_c_string */ -static CYTHON_INLINE PyObject* __Pyx_decode_c_string( - const char* cstring, Py_ssize_t start, Py_ssize_t stop, - const char* encoding, const char* errors, - PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { - Py_ssize_t length; - if (unlikely((start < 0) | (stop < 0))) { - size_t slen = strlen(cstring); - if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { - PyErr_SetString(PyExc_OverflowError, - "c-string too long to convert to Python"); - return NULL; - } - length = (Py_ssize_t) slen; - if (start < 0) { - start += length; - if (start < 0) - start = 0; - } - if (stop < 0) - stop += length; - } - if (unlikely(stop <= start)) - return __Pyx_NewRef(__pyx_empty_unicode); - length = stop - start; - cstring += start; - if (decode_func) { - return decode_func(cstring, length, errors); - } else { - return PyUnicode_Decode(cstring, length, encoding, errors); - } -} - -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (unlikely(!j)) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); - if (unlikely(!key)) return NULL; - r = mm->mp_subscript(o, key); - Py_DECREF(key); - return r; - } - if (likely(sm && sm->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return sm->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } -#endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); -} - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, 1); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - #endif - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else - #if CYTHON_COMPILING_IN_LIMITED_API - module = PyImport_ImportModuleLevelObject( - name, empty_dict, empty_dict, from_list, level); - #else - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif - #endif - } - } -bad: - Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif - return module; -} - -/* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 - PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif - "No module named '%U'", partial_name); -#endif -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -#endif -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; - nparts = PyTuple_GET_SIZE(parts_tuple); - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = PySequence_ITEM(parts_tuple, i); -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } - return module; -} -#endif -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s_; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} - -/* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; - PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif - CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { - return c_line; - } - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); - if (likely(cython_runtime_dict)) { - __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { - c_line = 0; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - return c_line; -} -#endif - -/* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} -#endif - -/* AddTraceback */ -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); - } - _PyTraceback_Add(funcname, filename, py_line); -} -#else -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = NULL; - PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - funcname = PyUnicode_AsUTF8(py_funcname); - if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif - } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else - py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline - return py_code; -bad: - Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject *ptype, *pvalue, *ptraceback; - if (c_line) { - c_line = __Pyx_CLineForTraceback(tstate, c_line); - } - py_code = __pyx_find_code_object(c_line ? -c_line : py_line); - if (!py_code) { - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) { - /* If the code object creation fails, then we should clear the - fetched exception references and propagate the new exception */ - Py_XDECREF(ptype); - Py_XDECREF(pvalue); - Py_XDECREF(ptraceback); - goto bad; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); - } - py_frame = PyFrame_New( - tstate, /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} -#endif - -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int neg_one = (int) -1, const_zero = (int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (int) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (int) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int8_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int8_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int8_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int8_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int16_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int16_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int16_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int16_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int32_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int32_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int32_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int32_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int64_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int64_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int64_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int64_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(uint8_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(uint8_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(uint8_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(uint16_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(uint16_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(uint16_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(uint32_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(uint32_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(uint32_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(uint64_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(uint64_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(uint64_t), - little, !is_unsigned); - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(unsigned int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(unsigned int) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(unsigned int), - little, !is_unsigned); - } -} - -/* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API -static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) -{ - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__2)); - } - return name; -} -#endif - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); -#if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } -#endif - if (likely(v)) { - int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - long idigit; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (unlikely(!PyLong_CheckExact(v))) { - PyObject *tmp = v; - v = PyNumber_Long(v); - assert(PyLong_CheckExact(v)); - Py_DECREF(tmp); - if (unlikely(!v)) return (long) -1; - } -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(x) == 0) - return (long) 0; - is_negative = Py_SIZE(x) < 0; -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - is_negative = result == 1; - } -#endif - if (is_unsigned && unlikely(is_negative)) { - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - if (unlikely(!stepval)) - return (long) -1; - } else { - stepval = __Pyx_NewRef(v); - } - val = (long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - if (Py_SIZE(stepval) == 0) - goto unpacking_done; - #endif - } - idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((long) idigit) << bits; - #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 - unpacking_done: - #endif - if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - Py_DECREF(v); - if (likely(!ret)) - return val; - } - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* FastTypeChecks */ -#if CYTHON_COMPILING_IN_CPYTHON -static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { - while (a) { - a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); - if (a == b) - return 1; - } - return b == &PyBaseObject_Type; -} -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (a == b) return 1; - mro = a->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(a, b); -} -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (cls == a || cls == b) return 1; - mro = cls->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - PyObject *base = PyTuple_GET_ITEM(mro, i); - if (base == (PyObject *)a || base == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else -static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { - if (exc_type1) { - return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); - } else { - return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); - } -} -#endif -static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - assert(PyExceptionClass_Check(exc_type)); - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; i '9'); - break; - } - if (rt_from_call[i] != ctversion[i]) { - same = 0; - break; - } - } - if (!same) { - char rtversion[5] = {'\0'}; - char message[200]; - for (i=0; i<4; ++i) { - if (rt_from_call[i] == '.') { - if (found_dot) break; - found_dot = 1; - } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { - break; - } - rtversion[i] = rt_from_call[i]; - } - PyOS_snprintf(message, sizeof(message), - "compile time version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* FunctionExport */ -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); - if (!d) { - PyErr_Clear(); - d = PyDict_New(); - if (!d) - goto bad; - Py_INCREF(d); - if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) - goto bad; - } - tmp.fp = f; - cobj = PyCapsule_New(tmp.p, sig, 0); - if (!cobj) - goto bad; - if (PyDict_SetItemString(d, name, cobj) < 0) - goto bad; - Py_DECREF(cobj); - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(cobj); - Py_XDECREF(d); - return -1; -} - -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); - } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); - } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); - } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} -#endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - if (!*t->p) - return -1; - if (PyObject_Hash(*t->p) == -1) - return -1; - #endif - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} -#else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (likely(PyUnicode_IS_ASCII(o))) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -} -#endif -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { - return __Pyx_PyUnicode_AsStringAndSize(o, length); - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { - int retval; - if (unlikely(!x)) return -1; - retval = __Pyx_PyObject_IsTrue(x); - Py_DECREF(x); - return retval; -} -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 - if (PyLong_Check(result)) { - if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, - "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " - "The ability to return an instance of a strict subclass of int is deprecated, " - "and may be removed in a future version of Python.", - result_type_name)) { - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; - } - __Pyx_DECREF_TypeName(result_type_name); - return result; - } -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { -#if CYTHON_USE_TYPE_SLOTS - PyNumberMethods *m; -#endif - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else - if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); -#if CYTHON_USE_TYPE_SLOTS - m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else - if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); - } - #endif -#else - if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); - } -#endif - if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(__Pyx_PyLong_IsCompact(b))) { - return __Pyx_PyLong_CompactValue(b); - } else { - const digit* digits = __Pyx_PyLong_Digits(b); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { - if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { - return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif - } else { - Py_ssize_t ival; - PyObject *x; - x = PyNumber_Index(o); - if (!x) return -1; - ival = PyInt_AsLong(x); - Py_DECREF(x); - return ival; - } -} -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -/* #### Code section: utility_code_pragmas_end ### */ -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - - - -/* #### Code section: end ### */ -#endif /* Py_PYTHON_H */ From e646ba37e50670a441f71fdf51877bbe361163e0 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Fri, 25 Aug 2023 17:49:28 +0800 Subject: [PATCH 08/31] remove temp file --- poetry.lock | 987 ---------------------------------------------------- temp | 30 -- 2 files changed, 1017 deletions(-) delete mode 100644 poetry.lock delete mode 100644 temp diff --git a/poetry.lock b/poetry.lock deleted file mode 100644 index 8d03f0d3..00000000 --- a/poetry.lock +++ /dev/null @@ -1,987 +0,0 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. - -[[package]] -name = "atomicwrites" -version = "1.4.1" -description = "Atomic file writes." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "atomicwrites-1.4.1.tar.gz", hash = "sha256:81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11"}, -] - -[[package]] -name = "attrs" -version = "23.1.0" -description = "Classes Without Boilerplate" -optional = false -python-versions = ">=3.7" -files = [ - {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, - {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, -] - -[package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - -[package.extras] -cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] -dev = ["attrs[docs,tests]", "pre-commit"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] -tests = ["attrs[tests-no-zope]", "zope-interface"] -tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] - -[[package]] -name = "black" -version = "22.8.0" -description = "The uncompromising code formatter." -optional = false -python-versions = ">=3.6.2" -files = [ - {file = "black-22.8.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ce957f1d6b78a8a231b18e0dd2d94a33d2ba738cd88a7fe64f53f659eea49fdd"}, - {file = "black-22.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5107ea36b2b61917956d018bd25129baf9ad1125e39324a9b18248d362156a27"}, - {file = "black-22.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e8166b7bfe5dcb56d325385bd1d1e0f635f24aae14b3ae437102dedc0c186747"}, - {file = "black-22.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd82842bb272297503cbec1a2600b6bfb338dae017186f8f215c8958f8acf869"}, - {file = "black-22.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d839150f61d09e7217f52917259831fe2b689f5c8e5e32611736351b89bb2a90"}, - {file = "black-22.8.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a05da0430bd5ced89176db098567973be52ce175a55677436a271102d7eaa3fe"}, - {file = "black-22.8.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a098a69a02596e1f2a58a2a1c8d5a05d5a74461af552b371e82f9fa4ada8342"}, - {file = "black-22.8.0-cp36-cp36m-win_amd64.whl", hash = "sha256:5594efbdc35426e35a7defa1ea1a1cb97c7dbd34c0e49af7fb593a36bd45edab"}, - {file = "black-22.8.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a983526af1bea1e4cf6768e649990f28ee4f4137266921c2c3cee8116ae42ec3"}, - {file = "black-22.8.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b2c25f8dea5e8444bdc6788a2f543e1fb01494e144480bc17f806178378005e"}, - {file = "black-22.8.0-cp37-cp37m-win_amd64.whl", hash = "sha256:78dd85caaab7c3153054756b9fe8c611efa63d9e7aecfa33e533060cb14b6d16"}, - {file = "black-22.8.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:cea1b2542d4e2c02c332e83150e41e3ca80dc0fb8de20df3c5e98e242156222c"}, - {file = "black-22.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5b879eb439094751185d1cfdca43023bc6786bd3c60372462b6f051efa6281a5"}, - {file = "black-22.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0a12e4e1353819af41df998b02c6742643cfef58282915f781d0e4dd7a200411"}, - {file = "black-22.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3a73f66b6d5ba7288cd5d6dad9b4c9b43f4e8a4b789a94bf5abfb878c663eb3"}, - {file = "black-22.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:e981e20ec152dfb3e77418fb616077937378b322d7b26aa1ff87717fb18b4875"}, - {file = "black-22.8.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8ce13ffed7e66dda0da3e0b2eb1bdfc83f5812f66e09aca2b0978593ed636b6c"}, - {file = "black-22.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:32a4b17f644fc288c6ee2bafdf5e3b045f4eff84693ac069d87b1a347d861497"}, - {file = "black-22.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0ad827325a3a634bae88ae7747db1a395d5ee02cf05d9aa7a9bd77dfb10e940c"}, - {file = "black-22.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53198e28a1fb865e9fe97f88220da2e44df6da82b18833b588b1883b16bb5d41"}, - {file = "black-22.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:bc4d4123830a2d190e9cc42a2e43570f82ace35c3aeb26a512a2102bce5af7ec"}, - {file = "black-22.8.0-py3-none-any.whl", hash = "sha256:d2c21d439b2baf7aa80d6dd4e3659259be64c6f49dfd0f32091063db0e006db4"}, - {file = "black-22.8.0.tar.gz", hash = "sha256:792f7eb540ba9a17e8656538701d3eb1afcb134e3b45b71f20b25c77a8db7e6e"}, -] - -[package.dependencies] -click = ">=8.0.0" -dataclasses = {version = ">=0.6", markers = "python_version < \"3.7\""} -mypy-extensions = ">=0.4.3" -pathspec = ">=0.9.0" -platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} -typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} -typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] - -[[package]] -name = "certifi" -version = "2023.7.22" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.6" -files = [ - {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, - {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, -] - -[[package]] -name = "charset-normalizer" -version = "2.0.12" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -optional = false -python-versions = ">=3.5.0" -files = [ - {file = "charset-normalizer-2.0.12.tar.gz", hash = "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597"}, - {file = "charset_normalizer-2.0.12-py3-none-any.whl", hash = "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df"}, -] - -[package.extras] -unicode-backport = ["unicodedata2"] - -[[package]] -name = "click" -version = "8.0.4" -description = "Composable command line interface toolkit" -optional = false -python-versions = ">=3.6" -files = [ - {file = "click-8.0.4-py3-none-any.whl", hash = "sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1"}, - {file = "click-8.0.4.tar.gz", hash = "sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "coverage" -version = "6.2" -description = "Code coverage measurement for Python" -optional = false -python-versions = ">=3.6" -files = [ - {file = "coverage-6.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6dbc1536e105adda7a6312c778f15aaabe583b0e9a0b0a324990334fd458c94b"}, - {file = "coverage-6.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:174cf9b4bef0db2e8244f82059a5a72bd47e1d40e71c68ab055425172b16b7d0"}, - {file = "coverage-6.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:92b8c845527eae547a2a6617d336adc56394050c3ed8a6918683646328fbb6da"}, - {file = "coverage-6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c7912d1526299cb04c88288e148c6c87c0df600eca76efd99d84396cfe00ef1d"}, - {file = "coverage-6.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d5d2033d5db1d58ae2d62f095e1aefb6988af65b4b12cb8987af409587cc0739"}, - {file = "coverage-6.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3feac4084291642165c3a0d9eaebedf19ffa505016c4d3db15bfe235718d4971"}, - {file = "coverage-6.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:276651978c94a8c5672ea60a2656e95a3cce2a3f31e9fb2d5ebd4c215d095840"}, - {file = "coverage-6.2-cp310-cp310-win32.whl", hash = "sha256:f506af4f27def639ba45789fa6fde45f9a217da0be05f8910458e4557eed020c"}, - {file = "coverage-6.2-cp310-cp310-win_amd64.whl", hash = "sha256:3f7c17209eef285c86f819ff04a6d4cbee9b33ef05cbcaae4c0b4e8e06b3ec8f"}, - {file = "coverage-6.2-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:13362889b2d46e8d9f97c421539c97c963e34031ab0cb89e8ca83a10cc71ac76"}, - {file = "coverage-6.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:22e60a3ca5acba37d1d4a2ee66e051f5b0e1b9ac950b5b0cf4aa5366eda41d47"}, - {file = "coverage-6.2-cp311-cp311-win_amd64.whl", hash = "sha256:b637c57fdb8be84e91fac60d9325a66a5981f8086c954ea2772efe28425eaf64"}, - {file = "coverage-6.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f467bbb837691ab5a8ca359199d3429a11a01e6dfb3d9dcc676dc035ca93c0a9"}, - {file = "coverage-6.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2641f803ee9f95b1f387f3e8f3bf28d83d9b69a39e9911e5bfee832bea75240d"}, - {file = "coverage-6.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:1219d760ccfafc03c0822ae2e06e3b1248a8e6d1a70928966bafc6838d3c9e48"}, - {file = "coverage-6.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9a2b5b52be0a8626fcbffd7e689781bf8c2ac01613e77feda93d96184949a98e"}, - {file = "coverage-6.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:8e2c35a4c1f269704e90888e56f794e2d9c0262fb0c1b1c8c4ee44d9b9e77b5d"}, - {file = "coverage-6.2-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:5d6b09c972ce9200264c35a1d53d43ca55ef61836d9ec60f0d44273a31aa9f17"}, - {file = "coverage-6.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e3db840a4dee542e37e09f30859f1612da90e1c5239a6a2498c473183a50e781"}, - {file = "coverage-6.2-cp36-cp36m-win32.whl", hash = "sha256:4e547122ca2d244f7c090fe3f4b5a5861255ff66b7ab6d98f44a0222aaf8671a"}, - {file = "coverage-6.2-cp36-cp36m-win_amd64.whl", hash = "sha256:01774a2c2c729619760320270e42cd9e797427ecfddd32c2a7b639cdc481f3c0"}, - {file = "coverage-6.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:fb8b8ee99b3fffe4fd86f4c81b35a6bf7e4462cba019997af2fe679365db0c49"}, - {file = "coverage-6.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:619346d57c7126ae49ac95b11b0dc8e36c1dd49d148477461bb66c8cf13bb521"}, - {file = "coverage-6.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0a7726f74ff63f41e95ed3a89fef002916c828bb5fcae83b505b49d81a066884"}, - {file = "coverage-6.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cfd9386c1d6f13b37e05a91a8583e802f8059bebfccde61a418c5808dea6bbfa"}, - {file = "coverage-6.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:17e6c11038d4ed6e8af1407d9e89a2904d573be29d51515f14262d7f10ef0a64"}, - {file = "coverage-6.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c254b03032d5a06de049ce8bca8338a5185f07fb76600afff3c161e053d88617"}, - {file = "coverage-6.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dca38a21e4423f3edb821292e97cec7ad38086f84313462098568baedf4331f8"}, - {file = "coverage-6.2-cp37-cp37m-win32.whl", hash = "sha256:600617008aa82032ddeace2535626d1bc212dfff32b43989539deda63b3f36e4"}, - {file = "coverage-6.2-cp37-cp37m-win_amd64.whl", hash = "sha256:bf154ba7ee2fd613eb541c2bc03d3d9ac667080a737449d1a3fb342740eb1a74"}, - {file = "coverage-6.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f9afb5b746781fc2abce26193d1c817b7eb0e11459510fba65d2bd77fe161d9e"}, - {file = "coverage-6.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edcada2e24ed68f019175c2b2af2a8b481d3d084798b8c20d15d34f5c733fa58"}, - {file = "coverage-6.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a9c8c4283e17690ff1a7427123ffb428ad6a52ed720d550e299e8291e33184dc"}, - {file = "coverage-6.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f614fc9956d76d8a88a88bb41ddc12709caa755666f580af3a688899721efecd"}, - {file = "coverage-6.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9365ed5cce5d0cf2c10afc6add145c5037d3148585b8ae0e77cc1efdd6aa2953"}, - {file = "coverage-6.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8bdfe9ff3a4ea37d17f172ac0dff1e1c383aec17a636b9b35906babc9f0f5475"}, - {file = "coverage-6.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:63c424e6f5b4ab1cf1e23a43b12f542b0ec2e54f99ec9f11b75382152981df57"}, - {file = "coverage-6.2-cp38-cp38-win32.whl", hash = "sha256:49dbff64961bc9bdd2289a2bda6a3a5a331964ba5497f694e2cbd540d656dc1c"}, - {file = "coverage-6.2-cp38-cp38-win_amd64.whl", hash = "sha256:9a29311bd6429be317c1f3fe4bc06c4c5ee45e2fa61b2a19d4d1d6111cb94af2"}, - {file = "coverage-6.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:03b20e52b7d31be571c9c06b74746746d4eb82fc260e594dc662ed48145e9efd"}, - {file = "coverage-6.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:215f8afcc02a24c2d9a10d3790b21054b58d71f4b3c6f055d4bb1b15cecce685"}, - {file = "coverage-6.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a4bdeb0a52d1d04123b41d90a4390b096f3ef38eee35e11f0b22c2d031222c6c"}, - {file = "coverage-6.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c332d8f8d448ded473b97fefe4a0983265af21917d8b0cdcb8bb06b2afe632c3"}, - {file = "coverage-6.2-cp39-cp39-win32.whl", hash = "sha256:6e1394d24d5938e561fbeaa0cd3d356207579c28bd1792f25a068743f2d5b282"}, - {file = "coverage-6.2-cp39-cp39-win_amd64.whl", hash = "sha256:86f2e78b1eff847609b1ca8050c9e1fa3bd44ce755b2ec30e70f2d3ba3844644"}, - {file = "coverage-6.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:5829192582c0ec8ca4a2532407bc14c2f338d9878a10442f5d03804a95fac9de"}, - {file = "coverage-6.2.tar.gz", hash = "sha256:e2cad8093172b7d1595b4ad66f24270808658e11acf43a8f95b41276162eb5b8"}, -] - -[package.dependencies] -tomli = {version = "*", optional = true, markers = "extra == \"toml\""} - -[package.extras] -toml = ["tomli"] - -[[package]] -name = "cython" -version = "3.0.0" -description = "The Cython compiler for writing C extensions in the Python language." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "Cython-3.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7c7d728e1a49ad01d41181e3a9ea80b8d14e825f4679e4dd837cbf7bca7998a5"}, - {file = "Cython-3.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:626a4a6ef4b7ced87c348ea805488e4bd39dad9d0b39659aa9e1040b62bbfedf"}, - {file = "Cython-3.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:33c900d1ca9f622b969ac7d8fc44bdae140a4a6c7d8819413b51f3ccd0586a09"}, - {file = "Cython-3.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a65bc50dc1bc2faeafd9425defbdef6a468974f5c4192497ff7f14adccfdcd32"}, - {file = "Cython-3.0.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3b71b399b10b038b056ad12dce1e317a8aa7a96e99de7e4fa2fa5d1c9415cfb9"}, - {file = "Cython-3.0.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f42f304c097cc53e9eb5f1a1d150380353d5018a3191f1b77f0de353c762181e"}, - {file = "Cython-3.0.0-cp310-cp310-win32.whl", hash = "sha256:3e234e2549e808d9259fdb23ebcfd145be30c638c65118326ec33a8d29248dc2"}, - {file = "Cython-3.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:829c8333195100448a23863cf64a07e1334fae6a275aefe871458937911531b6"}, - {file = "Cython-3.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:06db81b1a01858fcc406616f8528e686ffb6cf7c3d78fb83767832bfecea8ad8"}, - {file = "Cython-3.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c93634845238645ce7abf63a56b1c5b6248189005c7caff898fd4a0dac1c5e1e"}, - {file = "Cython-3.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa606675c6bd23478b1d174e2a84e3c5a2c660968f97dc455afe0fae198f9d3d"}, - {file = "Cython-3.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d3355e6f690184f984eeb108b0f5bbc4bcf8b9444f8168933acf79603abf7baf"}, - {file = "Cython-3.0.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:93a34e1ca8afa4b7075b02ed14a7e4969256297029fb1bfd4cbe48f7290dbcff"}, - {file = "Cython-3.0.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bb1165ca9e78823f9ad1efa5b3d83156f868eabd679a615d140a3021bb92cd65"}, - {file = "Cython-3.0.0-cp311-cp311-win32.whl", hash = "sha256:2fadde1da055944f5e1e17625055f54ddd11f451889110278ef30e07bd5e1695"}, - {file = "Cython-3.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:254ed1f03a6c237fa64f0c6e44862058de65bfa2e6a3b48ca3c205492e0653aa"}, - {file = "Cython-3.0.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:4e212237b7531759befb92699c452cd65074a78051ae4ee36ff8b237395ecf3d"}, - {file = "Cython-3.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f29307463eba53747b31f71394ed087e3e3e264dcc433e62de1d51f5c0c966c"}, - {file = "Cython-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53328a8af0806bebbdb48a4191883b11ee9d9dfb084d84f58fa5a8ab58baefc9"}, - {file = "Cython-3.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5962e70b15e863e72bed6910e8c6ffef77d36cc98e2b31c474378f3b9e49b0e3"}, - {file = "Cython-3.0.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9e69139f4e60ab14c50767a568612ea64d6907e9c8e0289590a170eb495e005f"}, - {file = "Cython-3.0.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c40bdbcb2286f0aeeb5df9ce53d45da2d2a9b36a16b331cd0809d212d22a8fc7"}, - {file = "Cython-3.0.0-cp312-cp312-win32.whl", hash = "sha256:8abb8915eb2e57fa53d918afe641c05d1bcc6ed1913682ec1f28de71f4e3f398"}, - {file = "Cython-3.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:30a4bd2481e59bd7ab2539f835b78edc19fc455811e476916f56026b93afd28b"}, - {file = "Cython-3.0.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:0e1e4b7e4bfbf22fecfa5b852f0e499c442d4853b7ebd33ae37cdec9826ed5d8"}, - {file = "Cython-3.0.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b00df42cdd1a285a64491ba23de08ab14169d3257c840428d40eb7e8e9979af"}, - {file = "Cython-3.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:650d03ddddc08b051b4659778733f0f173ca7d327415755c05d265a6c1ba02fb"}, - {file = "Cython-3.0.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4965f2ebade17166f21a508d66dd60d2a0b3a3b90abe3f72003baa17ae020dd6"}, - {file = "Cython-3.0.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:4123c8d03167803df31da6b39de167cb9c04ac0aa4e35d4e5aa9d08ad511b84d"}, - {file = "Cython-3.0.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:296c53b6c0030cf82987eef163444e8d7631cc139d995f9d58679d9fd1ddbf31"}, - {file = "Cython-3.0.0-cp36-cp36m-win32.whl", hash = "sha256:0d2c1e172f1c81bafcca703093608e10dc16e3e2d24c5644c17606c7fdb1792c"}, - {file = "Cython-3.0.0-cp36-cp36m-win_amd64.whl", hash = "sha256:bc816d8eb3686d6f8d165f4156bac18c1147e1035dc28a76742d0b7fb5b7c032"}, - {file = "Cython-3.0.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8d86651347bbdbac1aca1824696c5e4c0a3b162946c422edcca2be12a03744d1"}, - {file = "Cython-3.0.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:84176bd04ce9f3cc8799b47ec6d1959fa1ea5e71424507df7bbf0b0915bbedef"}, - {file = "Cython-3.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35abcf07b8277ec95bbe49a07b5c8760a2d941942ccfe759a94c8d2fe5602e9f"}, - {file = "Cython-3.0.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a44d6b9a29b2bff38bb648577b2fcf6a68cf8b1783eee89c2eb749f69494b98d"}, - {file = "Cython-3.0.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:4dc6bbe7cf079db37f1ebb9b0f10d0d7f29e293bb8688e92d50b5ea7a91d82f3"}, - {file = "Cython-3.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e28763e75e380b8be62b02266a7995a781997c97c119efbdccb8fb954bcd7574"}, - {file = "Cython-3.0.0-cp37-cp37m-win32.whl", hash = "sha256:edae615cb4af51d5173e76ba9aea212424d025c57012e9cdf2f131f774c5ba71"}, - {file = "Cython-3.0.0-cp37-cp37m-win_amd64.whl", hash = "sha256:20c604e974832aaf8b7a1f5455ee7274b34df62a35ee095cd7d2ed7e818e6c53"}, - {file = "Cython-3.0.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c85fd2b1cbd9400d60ebe074795bb9a9188752f1612be3b35b0831a24879b91f"}, - {file = "Cython-3.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:090256c687106932339f87f888b95f0d69c617bc9b18801555545b695d29d8ab"}, - {file = "Cython-3.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cec2a67a0a7d9d4399758c0657ca03e5912e37218859cfbf046242cc532bfb3b"}, - {file = "Cython-3.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a1cdd01ce45333bc264a218c6e183700d6b998f029233f586a53c9b13455c2d2"}, - {file = "Cython-3.0.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ecee663d2d50ca939fc5db81f2f8a219c2417b4651ad84254c50a03a9cb1aadd"}, - {file = "Cython-3.0.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:30f10e79393b411af7677c270ea69807acb9fc30205c8ff25561f4deef780ec1"}, - {file = "Cython-3.0.0-cp38-cp38-win32.whl", hash = "sha256:609777d3a7a0a23b225e84d967af4ad2485c8bdfcacef8037cf197e87d431ca0"}, - {file = "Cython-3.0.0-cp38-cp38-win_amd64.whl", hash = "sha256:7f4a6dfd42ae0a45797f50fc4f6add702abf46ab3e7cd61811a6c6a97a40e1a2"}, - {file = "Cython-3.0.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2d8158277c8942c0b20ff4c074fe6a51c5b89e6ac60cef606818de8c92773596"}, - {file = "Cython-3.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54e34f99b2a8c1e11478541b2822e6408c132b98b6b8f5ed89411e5e906631ea"}, - {file = "Cython-3.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:877d1c8745df59dd2061a0636c602729e9533ba13f13aa73a498f68662e1cbde"}, - {file = "Cython-3.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:204690be60f0ff32eb70b04f28ef0d1e50ffd7b3f77ba06a7dc2389ee3b848e0"}, - {file = "Cython-3.0.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:06fcb4628ccce2ba5abc8630adbeaf4016f63a359b4c6c3827b2d80e0673981c"}, - {file = "Cython-3.0.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:090e24cfa31c926d0b13d8bb2ef48175acdd061ae1413343c94a2b12a4a4fa6f"}, - {file = "Cython-3.0.0-cp39-cp39-win32.whl", hash = "sha256:4cd00f2158dc00f7f93a92444d0f663eda124c9c29bbbd658964f4e89c357fe8"}, - {file = "Cython-3.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:5b4cc896d49ce2bae8d6a030f9a4c64965b59c38acfbf4617685e17f7fcf1731"}, - {file = "Cython-3.0.0-py2.py3-none-any.whl", hash = "sha256:ff1aef1a03cfe293237c7a86ae9625b0411b2df30c53d1a7f29a8d381f38a1df"}, - {file = "Cython-3.0.0.tar.gz", hash = "sha256:350b18f9673e63101dbbfcf774ee2f57c20ac4636d255741d76ca79016b1bd82"}, -] - -[[package]] -name = "dataclasses" -version = "0.8" -description = "A backport of the dataclasses module for Python 3.6" -optional = false -python-versions = ">=3.6, <3.7" -files = [ - {file = "dataclasses-0.8-py3-none-any.whl", hash = "sha256:0201d89fa866f68c8ebd9d08ee6ff50c0b255f8ec63a71c16fda7af82bb887bf"}, - {file = "dataclasses-0.8.tar.gz", hash = "sha256:8479067f342acf957dc82ec415d355ab5edb7e7646b90dc6e2fd1d96ad084c97"}, -] - -[[package]] -name = "greenlet" -version = "2.0.2" -description = "Lightweight in-process concurrent programming" -optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" -files = [ - {file = "greenlet-2.0.2-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:bdfea8c661e80d3c1c99ad7c3ff74e6e87184895bbaca6ee8cc61209f8b9b85d"}, - {file = "greenlet-2.0.2-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:9d14b83fab60d5e8abe587d51c75b252bcc21683f24699ada8fb275d7712f5a9"}, - {file = "greenlet-2.0.2-cp27-cp27m-win32.whl", hash = "sha256:6c3acb79b0bfd4fe733dff8bc62695283b57949ebcca05ae5c129eb606ff2d74"}, - {file = "greenlet-2.0.2-cp27-cp27m-win_amd64.whl", hash = "sha256:283737e0da3f08bd637b5ad058507e578dd462db259f7f6e4c5c365ba4ee9343"}, - {file = "greenlet-2.0.2-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:d27ec7509b9c18b6d73f2f5ede2622441de812e7b1a80bbd446cb0633bd3d5ae"}, - {file = "greenlet-2.0.2-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:30bcf80dda7f15ac77ba5af2b961bdd9dbc77fd4ac6105cee85b0d0a5fcf74df"}, - {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:26fbfce90728d82bc9e6c38ea4d038cba20b7faf8a0ca53a9c07b67318d46088"}, - {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9190f09060ea4debddd24665d6804b995a9c122ef5917ab26e1566dcc712ceeb"}, - {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d75209eed723105f9596807495d58d10b3470fa6732dd6756595e89925ce2470"}, - {file = "greenlet-2.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3a51c9751078733d88e013587b108f1b7a1fb106d402fb390740f002b6f6551a"}, - {file = "greenlet-2.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:76ae285c8104046b3a7f06b42f29c7b73f77683df18c49ab5af7983994c2dd91"}, - {file = "greenlet-2.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:2d4686f195e32d36b4d7cf2d166857dbd0ee9f3d20ae349b6bf8afc8485b3645"}, - {file = "greenlet-2.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c4302695ad8027363e96311df24ee28978162cdcdd2006476c43970b384a244c"}, - {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c48f54ef8e05f04d6eff74b8233f6063cb1ed960243eacc474ee73a2ea8573ca"}, - {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a1846f1b999e78e13837c93c778dcfc3365902cfb8d1bdb7dd73ead37059f0d0"}, - {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a06ad5312349fec0ab944664b01d26f8d1f05009566339ac6f63f56589bc1a2"}, - {file = "greenlet-2.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:eff4eb9b7eb3e4d0cae3d28c283dc16d9bed6b193c2e1ace3ed86ce48ea8df19"}, - {file = "greenlet-2.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5454276c07d27a740c5892f4907c86327b632127dd9abec42ee62e12427ff7e3"}, - {file = "greenlet-2.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:7cafd1208fdbe93b67c7086876f061f660cfddc44f404279c1585bbf3cdc64c5"}, - {file = "greenlet-2.0.2-cp35-cp35m-macosx_10_14_x86_64.whl", hash = "sha256:910841381caba4f744a44bf81bfd573c94e10b3045ee00de0cbf436fe50673a6"}, - {file = "greenlet-2.0.2-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:18a7f18b82b52ee85322d7a7874e676f34ab319b9f8cce5de06067384aa8ff43"}, - {file = "greenlet-2.0.2-cp35-cp35m-win32.whl", hash = "sha256:03a8f4f3430c3b3ff8d10a2a86028c660355ab637cee9333d63d66b56f09d52a"}, - {file = "greenlet-2.0.2-cp35-cp35m-win_amd64.whl", hash = "sha256:4b58adb399c4d61d912c4c331984d60eb66565175cdf4a34792cd9600f21b394"}, - {file = "greenlet-2.0.2-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:703f18f3fda276b9a916f0934d2fb6d989bf0b4fb5a64825260eb9bfd52d78f0"}, - {file = "greenlet-2.0.2-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:32e5b64b148966d9cccc2c8d35a671409e45f195864560829f395a54226408d3"}, - {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2dd11f291565a81d71dab10b7033395b7a3a5456e637cf997a6f33ebdf06f8db"}, - {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e0f72c9ddb8cd28532185f54cc1453f2c16fb417a08b53a855c4e6a418edd099"}, - {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cd021c754b162c0fb55ad5d6b9d960db667faad0fa2ff25bb6e1301b0b6e6a75"}, - {file = "greenlet-2.0.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:3c9b12575734155d0c09d6c3e10dbd81665d5c18e1a7c6597df72fd05990c8cf"}, - {file = "greenlet-2.0.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:b9ec052b06a0524f0e35bd8790686a1da006bd911dd1ef7d50b77bfbad74e292"}, - {file = "greenlet-2.0.2-cp36-cp36m-win32.whl", hash = "sha256:dbfcfc0218093a19c252ca8eb9aee3d29cfdcb586df21049b9d777fd32c14fd9"}, - {file = "greenlet-2.0.2-cp36-cp36m-win_amd64.whl", hash = "sha256:9f35ec95538f50292f6d8f2c9c9f8a3c6540bbfec21c9e5b4b751e0a7c20864f"}, - {file = "greenlet-2.0.2-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:d5508f0b173e6aa47273bdc0a0b5ba055b59662ba7c7ee5119528f466585526b"}, - {file = "greenlet-2.0.2-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:f82d4d717d8ef19188687aa32b8363e96062911e63ba22a0cff7802a8e58e5f1"}, - {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9c59a2120b55788e800d82dfa99b9e156ff8f2227f07c5e3012a45a399620b7"}, - {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2780572ec463d44c1d3ae850239508dbeb9fed38e294c68d19a24d925d9223ca"}, - {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:937e9020b514ceedb9c830c55d5c9872abc90f4b5862f89c0887033ae33c6f73"}, - {file = "greenlet-2.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:36abbf031e1c0f79dd5d596bfaf8e921c41df2bdf54ee1eed921ce1f52999a86"}, - {file = "greenlet-2.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:18e98fb3de7dba1c0a852731c3070cf022d14f0d68b4c87a19cc1016f3bb8b33"}, - {file = "greenlet-2.0.2-cp37-cp37m-win32.whl", hash = "sha256:3f6ea9bd35eb450837a3d80e77b517ea5bc56b4647f5502cd28de13675ee12f7"}, - {file = "greenlet-2.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:7492e2b7bd7c9b9916388d9df23fa49d9b88ac0640db0a5b4ecc2b653bf451e3"}, - {file = "greenlet-2.0.2-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:b864ba53912b6c3ab6bcb2beb19f19edd01a6bfcbdfe1f37ddd1778abfe75a30"}, - {file = "greenlet-2.0.2-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:ba2956617f1c42598a308a84c6cf021a90ff3862eddafd20c3333d50f0edb45b"}, - {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc3a569657468b6f3fb60587e48356fe512c1754ca05a564f11366ac9e306526"}, - {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8eab883b3b2a38cc1e050819ef06a7e6344d4a990d24d45bc6f2cf959045a45b"}, - {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acd2162a36d3de67ee896c43effcd5ee3de247eb00354db411feb025aa319857"}, - {file = "greenlet-2.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:0bf60faf0bc2468089bdc5edd10555bab6e85152191df713e2ab1fcc86382b5a"}, - {file = "greenlet-2.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b0ef99cdbe2b682b9ccbb964743a6aca37905fda5e0452e5ee239b1654d37f2a"}, - {file = "greenlet-2.0.2-cp38-cp38-win32.whl", hash = "sha256:b80f600eddddce72320dbbc8e3784d16bd3fb7b517e82476d8da921f27d4b249"}, - {file = "greenlet-2.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:4d2e11331fc0c02b6e84b0d28ece3a36e0548ee1a1ce9ddde03752d9b79bba40"}, - {file = "greenlet-2.0.2-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:88d9ab96491d38a5ab7c56dd7a3cc37d83336ecc564e4e8816dbed12e5aaefc8"}, - {file = "greenlet-2.0.2-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:561091a7be172ab497a3527602d467e2b3fbe75f9e783d8b8ce403fa414f71a6"}, - {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:971ce5e14dc5e73715755d0ca2975ac88cfdaefcaab078a284fea6cfabf866df"}, - {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be4ed120b52ae4d974aa40215fcdfde9194d63541c7ded40ee12eb4dda57b76b"}, - {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94c817e84245513926588caf1152e3b559ff794d505555211ca041f032abbb6b"}, - {file = "greenlet-2.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1a819eef4b0e0b96bb0d98d797bef17dc1b4a10e8d7446be32d1da33e095dbb8"}, - {file = "greenlet-2.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7efde645ca1cc441d6dc4b48c0f7101e8d86b54c8530141b09fd31cef5149ec9"}, - {file = "greenlet-2.0.2-cp39-cp39-win32.whl", hash = "sha256:ea9872c80c132f4663822dd2a08d404073a5a9b5ba6155bea72fb2a79d1093b5"}, - {file = "greenlet-2.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:db1a39669102a1d8d12b57de2bb7e2ec9066a6f2b3da35ae511ff93b01b5d564"}, - {file = "greenlet-2.0.2.tar.gz", hash = "sha256:e7c8dc13af7db097bed64a051d2dd49e9f0af495c26995c00a9ee842690d34c0"}, -] - -[package.extras] -docs = ["Sphinx", "docutils (<0.18)"] -test = ["objgraph", "psutil"] - -[[package]] -name = "idna" -version = "3.4" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.5" -files = [ - {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, - {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, -] - -[[package]] -name = "importlib-metadata" -version = "6.7.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "importlib_metadata-6.7.0-py3-none-any.whl", hash = "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5"}, - {file = "importlib_metadata-6.7.0.tar.gz", hash = "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4"}, -] - -[package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] - -[[package]] -name = "iniconfig" -version = "2.0.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.7" -files = [ - {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, - {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, -] - -[[package]] -name = "iso8601" -version = "1.0.2" -description = "Simple module to parse ISO 8601 dates" -optional = false -python-versions = ">=3.6.2,<4.0" -files = [ - {file = "iso8601-1.0.2-py3-none-any.whl", hash = "sha256:d7bc01b1c2a43b259570bb307f057abc578786ea734ba2b87b836c5efc5bd443"}, - {file = "iso8601-1.0.2.tar.gz", hash = "sha256:27f503220e6845d9db954fb212b95b0362d8b7e6c1b2326a87061c3de93594b1"}, -] - -[[package]] -name = "mypy" -version = "0.910" -description = "Optional static typing for Python" -optional = false -python-versions = ">=3.5" -files = [ - {file = "mypy-0.910-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:a155d80ea6cee511a3694b108c4494a39f42de11ee4e61e72bc424c490e46457"}, - {file = "mypy-0.910-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:b94e4b785e304a04ea0828759172a15add27088520dc7e49ceade7834275bedb"}, - {file = "mypy-0.910-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:088cd9c7904b4ad80bec811053272986611b84221835e079be5bcad029e79dd9"}, - {file = "mypy-0.910-cp35-cp35m-win_amd64.whl", hash = "sha256:adaeee09bfde366d2c13fe6093a7df5df83c9a2ba98638c7d76b010694db760e"}, - {file = "mypy-0.910-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ecd2c3fe726758037234c93df7e98deb257fd15c24c9180dacf1ef829da5f921"}, - {file = "mypy-0.910-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:d9dd839eb0dc1bbe866a288ba3c1afc33a202015d2ad83b31e875b5905a079b6"}, - {file = "mypy-0.910-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:3e382b29f8e0ccf19a2df2b29a167591245df90c0b5a2542249873b5c1d78212"}, - {file = "mypy-0.910-cp36-cp36m-win_amd64.whl", hash = "sha256:53fd2eb27a8ee2892614370896956af2ff61254c275aaee4c230ae771cadd885"}, - {file = "mypy-0.910-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b6fb13123aeef4a3abbcfd7e71773ff3ff1526a7d3dc538f3929a49b42be03f0"}, - {file = "mypy-0.910-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e4dab234478e3bd3ce83bac4193b2ecd9cf94e720ddd95ce69840273bf44f6de"}, - {file = "mypy-0.910-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:7df1ead20c81371ccd6091fa3e2878559b5c4d4caadaf1a484cf88d93ca06703"}, - {file = "mypy-0.910-cp37-cp37m-win_amd64.whl", hash = "sha256:0aadfb2d3935988ec3815952e44058a3100499f5be5b28c34ac9d79f002a4a9a"}, - {file = "mypy-0.910-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ec4e0cd079db280b6bdabdc807047ff3e199f334050db5cbb91ba3e959a67504"}, - {file = "mypy-0.910-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:119bed3832d961f3a880787bf621634ba042cb8dc850a7429f643508eeac97b9"}, - {file = "mypy-0.910-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:866c41f28cee548475f146aa4d39a51cf3b6a84246969f3759cb3e9c742fc072"}, - {file = "mypy-0.910-cp38-cp38-win_amd64.whl", hash = "sha256:ceb6e0a6e27fb364fb3853389607cf7eb3a126ad335790fa1e14ed02fba50811"}, - {file = "mypy-0.910-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1a85e280d4d217150ce8cb1a6dddffd14e753a4e0c3cf90baabb32cefa41b59e"}, - {file = "mypy-0.910-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:42c266ced41b65ed40a282c575705325fa7991af370036d3f134518336636f5b"}, - {file = "mypy-0.910-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:3c4b8ca36877fc75339253721f69603a9c7fdb5d4d5a95a1a1b899d8b86a4de2"}, - {file = "mypy-0.910-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:c0df2d30ed496a08de5daed2a9ea807d07c21ae0ab23acf541ab88c24b26ab97"}, - {file = "mypy-0.910-cp39-cp39-win_amd64.whl", hash = "sha256:c6c2602dffb74867498f86e6129fd52a2770c48b7cd3ece77ada4fa38f94eba8"}, - {file = "mypy-0.910-py3-none-any.whl", hash = "sha256:ef565033fa5a958e62796867b1df10c40263ea9ded87164d67572834e57a174d"}, - {file = "mypy-0.910.tar.gz", hash = "sha256:704098302473cb31a218f1775a873b376b30b4c18229421e9e9dc8916fd16150"}, -] - -[package.dependencies] -mypy-extensions = ">=0.4.3,<0.5.0" -toml = "*" -typed-ast = {version = ">=1.4.0,<1.5.0", markers = "python_version < \"3.8\""} -typing-extensions = ">=3.7.4" - -[package.extras] -dmypy = ["psutil (>=4.0)"] -python2 = ["typed-ast (>=1.4.0,<1.5.0)"] - -[[package]] -name = "mypy-extensions" -version = "0.4.4" -description = "Experimental type system extensions for programs checked with the mypy typechecker." -optional = false -python-versions = ">=2.7" -files = [ - {file = "mypy_extensions-0.4.4.tar.gz", hash = "sha256:c8b707883a96efe9b4bb3aaf0dcc07e7e217d7d8368eec4db4049ee9e142f4fd"}, -] - -[[package]] -name = "numpy" -version = "1.24.4" -description = "Fundamental package for array computing in Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "numpy-1.24.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c0bfb52d2169d58c1cdb8cc1f16989101639b34c7d3ce60ed70b19c63eba0b64"}, - {file = "numpy-1.24.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ed094d4f0c177b1b8e7aa9cba7d6ceed51c0e569a5318ac0ca9a090680a6a1b1"}, - {file = "numpy-1.24.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79fc682a374c4a8ed08b331bef9c5f582585d1048fa6d80bc6c35bc384eee9b4"}, - {file = "numpy-1.24.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ffe43c74893dbf38c2b0a1f5428760a1a9c98285553c89e12d70a96a7f3a4d6"}, - {file = "numpy-1.24.4-cp310-cp310-win32.whl", hash = "sha256:4c21decb6ea94057331e111a5bed9a79d335658c27ce2adb580fb4d54f2ad9bc"}, - {file = "numpy-1.24.4-cp310-cp310-win_amd64.whl", hash = "sha256:b4bea75e47d9586d31e892a7401f76e909712a0fd510f58f5337bea9572c571e"}, - {file = "numpy-1.24.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f136bab9c2cfd8da131132c2cf6cc27331dd6fae65f95f69dcd4ae3c3639c810"}, - {file = "numpy-1.24.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e2926dac25b313635e4d6cf4dc4e51c8c0ebfed60b801c799ffc4c32bf3d1254"}, - {file = "numpy-1.24.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:222e40d0e2548690405b0b3c7b21d1169117391c2e82c378467ef9ab4c8f0da7"}, - {file = "numpy-1.24.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7215847ce88a85ce39baf9e89070cb860c98fdddacbaa6c0da3ffb31b3350bd5"}, - {file = "numpy-1.24.4-cp311-cp311-win32.whl", hash = "sha256:4979217d7de511a8d57f4b4b5b2b965f707768440c17cb70fbf254c4b225238d"}, - {file = "numpy-1.24.4-cp311-cp311-win_amd64.whl", hash = "sha256:b7b1fc9864d7d39e28f41d089bfd6353cb5f27ecd9905348c24187a768c79694"}, - {file = "numpy-1.24.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1452241c290f3e2a312c137a9999cdbf63f78864d63c79039bda65ee86943f61"}, - {file = "numpy-1.24.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:04640dab83f7c6c85abf9cd729c5b65f1ebd0ccf9de90b270cd61935eef0197f"}, - {file = "numpy-1.24.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5425b114831d1e77e4b5d812b69d11d962e104095a5b9c3b641a218abcc050e"}, - {file = "numpy-1.24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd80e219fd4c71fc3699fc1dadac5dcf4fd882bfc6f7ec53d30fa197b8ee22dc"}, - {file = "numpy-1.24.4-cp38-cp38-win32.whl", hash = "sha256:4602244f345453db537be5314d3983dbf5834a9701b7723ec28923e2889e0bb2"}, - {file = "numpy-1.24.4-cp38-cp38-win_amd64.whl", hash = "sha256:692f2e0f55794943c5bfff12b3f56f99af76f902fc47487bdfe97856de51a706"}, - {file = "numpy-1.24.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2541312fbf09977f3b3ad449c4e5f4bb55d0dbf79226d7724211acc905049400"}, - {file = "numpy-1.24.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9667575fb6d13c95f1b36aca12c5ee3356bf001b714fc354eb5465ce1609e62f"}, - {file = "numpy-1.24.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3a86ed21e4f87050382c7bc96571755193c4c1392490744ac73d660e8f564a9"}, - {file = "numpy-1.24.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d11efb4dbecbdf22508d55e48d9c8384db795e1b7b51ea735289ff96613ff74d"}, - {file = "numpy-1.24.4-cp39-cp39-win32.whl", hash = "sha256:6620c0acd41dbcb368610bb2f4d83145674040025e5536954782467100aa8835"}, - {file = "numpy-1.24.4-cp39-cp39-win_amd64.whl", hash = "sha256:befe2bf740fd8373cf56149a5c23a0f601e82869598d41f8e188a0e9869926f8"}, - {file = "numpy-1.24.4-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:31f13e25b4e304632a4619d0e0777662c2ffea99fcae2029556b17d8ff958aef"}, - {file = "numpy-1.24.4-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95f7ac6540e95bc440ad77f56e520da5bf877f87dca58bd095288dce8940532a"}, - {file = "numpy-1.24.4-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e98f220aa76ca2a977fe435f5b04d7b3470c0a2e6312907b37ba6068f26787f2"}, - {file = "numpy-1.24.4.tar.gz", hash = "sha256:80f5e3a4e498641401868df4208b74581206afbee7cf7b8329daae82676d9463"}, -] - -[[package]] -name = "numpy" -version = "1.25.2" -description = "Fundamental package for array computing in Python" -optional = false -python-versions = ">=3.9" -files = [ - {file = "numpy-1.25.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:db3ccc4e37a6873045580d413fe79b68e47a681af8db2e046f1dacfa11f86eb3"}, - {file = "numpy-1.25.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:90319e4f002795ccfc9050110bbbaa16c944b1c37c0baeea43c5fb881693ae1f"}, - {file = "numpy-1.25.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfe4a913e29b418d096e696ddd422d8a5d13ffba4ea91f9f60440a3b759b0187"}, - {file = "numpy-1.25.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f08f2e037bba04e707eebf4bc934f1972a315c883a9e0ebfa8a7756eabf9e357"}, - {file = "numpy-1.25.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bec1e7213c7cb00d67093247f8c4db156fd03075f49876957dca4711306d39c9"}, - {file = "numpy-1.25.2-cp310-cp310-win32.whl", hash = "sha256:7dc869c0c75988e1c693d0e2d5b26034644399dd929bc049db55395b1379e044"}, - {file = "numpy-1.25.2-cp310-cp310-win_amd64.whl", hash = "sha256:834b386f2b8210dca38c71a6e0f4fd6922f7d3fcff935dbe3a570945acb1b545"}, - {file = "numpy-1.25.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c5462d19336db4560041517dbb7759c21d181a67cb01b36ca109b2ae37d32418"}, - {file = "numpy-1.25.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5652ea24d33585ea39eb6a6a15dac87a1206a692719ff45d53c5282e66d4a8f"}, - {file = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2"}, - {file = "numpy-1.25.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:60e7f0f7f6d0eee8364b9a6304c2845b9c491ac706048c7e8cf47b83123b8dbf"}, - {file = "numpy-1.25.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bb33d5a1cf360304754913a350edda36d5b8c5331a8237268c48f91253c3a364"}, - {file = "numpy-1.25.2-cp311-cp311-win32.whl", hash = "sha256:5883c06bb92f2e6c8181df7b39971a5fb436288db58b5a1c3967702d4278691d"}, - {file = "numpy-1.25.2-cp311-cp311-win_amd64.whl", hash = "sha256:5c97325a0ba6f9d041feb9390924614b60b99209a71a69c876f71052521d42a4"}, - {file = "numpy-1.25.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b79e513d7aac42ae918db3ad1341a015488530d0bb2a6abcbdd10a3a829ccfd3"}, - {file = "numpy-1.25.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:eb942bfb6f84df5ce05dbf4b46673ffed0d3da59f13635ea9b926af3deb76926"}, - {file = "numpy-1.25.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e0746410e73384e70d286f93abf2520035250aad8c5714240b0492a7302fdca"}, - {file = "numpy-1.25.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7806500e4f5bdd04095e849265e55de20d8cc4b661b038957354327f6d9b295"}, - {file = "numpy-1.25.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8b77775f4b7df768967a7c8b3567e309f617dd5e99aeb886fa14dc1a0791141f"}, - {file = "numpy-1.25.2-cp39-cp39-win32.whl", hash = "sha256:2792d23d62ec51e50ce4d4b7d73de8f67a2fd3ea710dcbc8563a51a03fb07b01"}, - {file = "numpy-1.25.2-cp39-cp39-win_amd64.whl", hash = "sha256:76b4115d42a7dfc5d485d358728cdd8719be33cc5ec6ec08632a5d6fca2ed380"}, - {file = "numpy-1.25.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:1a1329e26f46230bf77b02cc19e900db9b52f398d6722ca853349a782d4cff55"}, - {file = "numpy-1.25.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c3abc71e8b6edba80a01a52e66d83c5d14433cbcd26a40c329ec7ed09f37901"}, - {file = "numpy-1.25.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:1b9735c27cea5d995496f46a8b1cd7b408b3f34b6d50459d9ac8fe3a20cc17bf"}, - {file = "numpy-1.25.2.tar.gz", hash = "sha256:fd608e19c8d7c55021dffd43bfe5492fab8cc105cc8986f813f8c3c048b38760"}, -] - -[[package]] -name = "packaging" -version = "23.1" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, - {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, -] - -[[package]] -name = "pandas" -version = "2.0.3" -description = "Powerful data structures for data analysis, time series, and statistics" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pandas-2.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e4c7c9f27a4185304c7caf96dc7d91bc60bc162221152de697c98eb0b2648dd8"}, - {file = "pandas-2.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f167beed68918d62bffb6ec64f2e1d8a7d297a038f86d4aed056b9493fca407f"}, - {file = "pandas-2.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce0c6f76a0f1ba361551f3e6dceaff06bde7514a374aa43e33b588ec10420183"}, - {file = "pandas-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba619e410a21d8c387a1ea6e8a0e49bb42216474436245718d7f2e88a2f8d7c0"}, - {file = "pandas-2.0.3-cp310-cp310-win32.whl", hash = "sha256:3ef285093b4fe5058eefd756100a367f27029913760773c8bf1d2d8bebe5d210"}, - {file = "pandas-2.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:9ee1a69328d5c36c98d8e74db06f4ad518a1840e8ccb94a4ba86920986bb617e"}, - {file = "pandas-2.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b084b91d8d66ab19f5bb3256cbd5ea661848338301940e17f4492b2ce0801fe8"}, - {file = "pandas-2.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:37673e3bdf1551b95bf5d4ce372b37770f9529743d2498032439371fc7b7eb26"}, - {file = "pandas-2.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b9cb1e14fdb546396b7e1b923ffaeeac24e4cedd14266c3497216dd4448e4f2d"}, - {file = "pandas-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d9cd88488cceb7635aebb84809d087468eb33551097d600c6dad13602029c2df"}, - {file = "pandas-2.0.3-cp311-cp311-win32.whl", hash = "sha256:694888a81198786f0e164ee3a581df7d505024fbb1f15202fc7db88a71d84ebd"}, - {file = "pandas-2.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:6a21ab5c89dcbd57f78d0ae16630b090eec626360085a4148693def5452d8a6b"}, - {file = "pandas-2.0.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9e4da0d45e7f34c069fe4d522359df7d23badf83abc1d1cef398895822d11061"}, - {file = "pandas-2.0.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:32fca2ee1b0d93dd71d979726b12b61faa06aeb93cf77468776287f41ff8fdc5"}, - {file = "pandas-2.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:258d3624b3ae734490e4d63c430256e716f488c4fcb7c8e9bde2d3aa46c29089"}, - {file = "pandas-2.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9eae3dc34fa1aa7772dd3fc60270d13ced7346fcbcfee017d3132ec625e23bb0"}, - {file = "pandas-2.0.3-cp38-cp38-win32.whl", hash = "sha256:f3421a7afb1a43f7e38e82e844e2bca9a6d793d66c1a7f9f0ff39a795bbc5e02"}, - {file = "pandas-2.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:69d7f3884c95da3a31ef82b7618af5710dba95bb885ffab339aad925c3e8ce78"}, - {file = "pandas-2.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5247fb1ba347c1261cbbf0fcfba4a3121fbb4029d95d9ef4dc45406620b25c8b"}, - {file = "pandas-2.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:81af086f4543c9d8bb128328b5d32e9986e0c84d3ee673a2ac6fb57fd14f755e"}, - {file = "pandas-2.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1994c789bf12a7c5098277fb43836ce090f1073858c10f9220998ac74f37c69b"}, - {file = "pandas-2.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ec591c48e29226bcbb316e0c1e9423622bc7a4eaf1ef7c3c9fa1a3981f89641"}, - {file = "pandas-2.0.3-cp39-cp39-win32.whl", hash = "sha256:04dbdbaf2e4d46ca8da896e1805bc04eb85caa9a82e259e8eed00254d5e0c682"}, - {file = "pandas-2.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:1168574b036cd8b93abc746171c9b4f1b83467438a5e45909fed645cf8692dbc"}, - {file = "pandas-2.0.3.tar.gz", hash = "sha256:c02f372a88e0d17f36d3093a644c73cfc1788e876a7c4bcb4020a77512e2043c"}, -] - -[package.dependencies] -numpy = [ - {version = ">=1.20.3", markers = "python_version < \"3.10\""}, - {version = ">=1.21.0", markers = "python_version >= \"3.10\""}, - {version = ">=1.23.2", markers = "python_version >= \"3.11\""}, -] -python-dateutil = ">=2.8.2" -pytz = ">=2020.1" -tzdata = ">=2022.1" - -[package.extras] -all = ["PyQt5 (>=5.15.1)", "SQLAlchemy (>=1.4.16)", "beautifulsoup4 (>=4.9.3)", "bottleneck (>=1.3.2)", "brotlipy (>=0.7.0)", "fastparquet (>=0.6.3)", "fsspec (>=2021.07.0)", "gcsfs (>=2021.07.0)", "html5lib (>=1.1)", "hypothesis (>=6.34.2)", "jinja2 (>=3.0.0)", "lxml (>=4.6.3)", "matplotlib (>=3.6.1)", "numba (>=0.53.1)", "numexpr (>=2.7.3)", "odfpy (>=1.4.1)", "openpyxl (>=3.0.7)", "pandas-gbq (>=0.15.0)", "psycopg2 (>=2.8.6)", "pyarrow (>=7.0.0)", "pymysql (>=1.0.2)", "pyreadstat (>=1.1.2)", "pytest (>=7.3.2)", "pytest-asyncio (>=0.17.0)", "pytest-xdist (>=2.2.0)", "python-snappy (>=0.6.0)", "pyxlsb (>=1.0.8)", "qtpy (>=2.2.0)", "s3fs (>=2021.08.0)", "scipy (>=1.7.1)", "tables (>=3.6.1)", "tabulate (>=0.8.9)", "xarray (>=0.21.0)", "xlrd (>=2.0.1)", "xlsxwriter (>=1.4.3)", "zstandard (>=0.15.2)"] -aws = ["s3fs (>=2021.08.0)"] -clipboard = ["PyQt5 (>=5.15.1)", "qtpy (>=2.2.0)"] -compression = ["brotlipy (>=0.7.0)", "python-snappy (>=0.6.0)", "zstandard (>=0.15.2)"] -computation = ["scipy (>=1.7.1)", "xarray (>=0.21.0)"] -excel = ["odfpy (>=1.4.1)", "openpyxl (>=3.0.7)", "pyxlsb (>=1.0.8)", "xlrd (>=2.0.1)", "xlsxwriter (>=1.4.3)"] -feather = ["pyarrow (>=7.0.0)"] -fss = ["fsspec (>=2021.07.0)"] -gcp = ["gcsfs (>=2021.07.0)", "pandas-gbq (>=0.15.0)"] -hdf5 = ["tables (>=3.6.1)"] -html = ["beautifulsoup4 (>=4.9.3)", "html5lib (>=1.1)", "lxml (>=4.6.3)"] -mysql = ["SQLAlchemy (>=1.4.16)", "pymysql (>=1.0.2)"] -output-formatting = ["jinja2 (>=3.0.0)", "tabulate (>=0.8.9)"] -parquet = ["pyarrow (>=7.0.0)"] -performance = ["bottleneck (>=1.3.2)", "numba (>=0.53.1)", "numexpr (>=2.7.1)"] -plot = ["matplotlib (>=3.6.1)"] -postgresql = ["SQLAlchemy (>=1.4.16)", "psycopg2 (>=2.8.6)"] -spss = ["pyreadstat (>=1.1.2)"] -sql-other = ["SQLAlchemy (>=1.4.16)"] -test = ["hypothesis (>=6.34.2)", "pytest (>=7.3.2)", "pytest-asyncio (>=0.17.0)", "pytest-xdist (>=2.2.0)"] -xml = ["lxml (>=4.6.3)"] - -[[package]] -name = "pathspec" -version = "0.9.0" -description = "Utility library for gitignore style pattern matching of file paths." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" -files = [ - {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, - {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, -] - -[[package]] -name = "platformdirs" -version = "2.4.0" -description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -optional = false -python-versions = ">=3.6" -files = [ - {file = "platformdirs-2.4.0-py3-none-any.whl", hash = "sha256:8868bbe3c3c80d42f20156f22e7131d2fb321f5bc86a2a345375c6481a67021d"}, - {file = "platformdirs-2.4.0.tar.gz", hash = "sha256:367a5e80b3d04d2428ffa76d33f124cf11e8fff2acdaa9b43d545f5c7d661ef2"}, -] - -[package.extras] -docs = ["Sphinx (>=4)", "furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)"] -test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"] - -[[package]] -name = "pluggy" -version = "1.2.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.7" -files = [ - {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, - {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, -] - -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] - -[[package]] -name = "py" -version = "1.11.0" -description = "library with cross-python path, ini-parsing, io, code, log facilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, - {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, -] - -[[package]] -name = "pytest" -version = "6.2.5" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.6" -files = [ - {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, - {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, -] - -[package.dependencies] -atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} -attrs = ">=19.2.0" -colorama = {version = "*", markers = "sys_platform == \"win32\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=0.12,<2.0" -py = ">=1.8.2" -toml = "*" - -[package.extras] -testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] - -[[package]] -name = "pytest-cov" -version = "4.0.0" -description = "Pytest plugin for measuring coverage." -optional = false -python-versions = ">=3.6" -files = [ - {file = "pytest-cov-4.0.0.tar.gz", hash = "sha256:996b79efde6433cdbd0088872dbc5fb3ed7fe1578b68cdbba634f14bb8dd0470"}, - {file = "pytest_cov-4.0.0-py3-none-any.whl", hash = "sha256:2feb1b751d66a8bd934e5edfa2e961d11309dc37b73b0eabe73b5945fee20f6b"}, -] - -[package.dependencies] -coverage = {version = ">=5.2.1", extras = ["toml"]} -pytest = ">=4.6" - -[package.extras] -testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] - -[[package]] -name = "python-dateutil" -version = "2.8.2" -description = "Extensions to the standard Python datetime module" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -files = [ - {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, - {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, -] - -[package.dependencies] -six = ">=1.5" - -[[package]] -name = "python-dotenv" -version = "0.20.0" -description = "Read key-value pairs from a .env file and set them as environment variables" -optional = false -python-versions = ">=3.5" -files = [ - {file = "python-dotenv-0.20.0.tar.gz", hash = "sha256:b7e3b04a59693c42c36f9ab1cc2acc46fa5df8c78e178fc33a8d4cd05c8d498f"}, - {file = "python_dotenv-0.20.0-py3-none-any.whl", hash = "sha256:d92a187be61fe482e4fd675b6d52200e7be63a12b724abbf931a40ce4fa92938"}, -] - -[package.extras] -cli = ["click (>=5.0)"] - -[[package]] -name = "pytz" -version = "2023.3" -description = "World timezone definitions, modern and historical" -optional = false -python-versions = "*" -files = [ - {file = "pytz-2023.3-py2.py3-none-any.whl", hash = "sha256:a151b3abb88eda1d4e34a9814df37de2a80e301e68ba0fd856fb9b46bfbbbffb"}, - {file = "pytz-2023.3.tar.gz", hash = "sha256:1d8ce29db189191fb55338ee6d0387d82ab59f3d00eac103412d64e0ebd0c588"}, -] - -[[package]] -name = "requests" -version = "2.27.1" -description = "Python HTTP for Humans." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" -files = [ - {file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"}, - {file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"}, -] - -[package.dependencies] -certifi = ">=2017.4.17" -charset-normalizer = {version = ">=2.0.0,<2.1.0", markers = "python_version >= \"3\""} -idna = {version = ">=2.5,<4", markers = "python_version >= \"3\""} -urllib3 = ">=1.21.1,<1.27" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] -use-chardet-on-py3 = ["chardet (>=3.0.2,<5)"] - -[[package]] -name = "six" -version = "1.16.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, -] - -[[package]] -name = "sqlalchemy" -version = "1.4.49" -description = "Database Abstraction Library" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" -files = [ - {file = "SQLAlchemy-1.4.49-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:2e126cf98b7fd38f1e33c64484406b78e937b1a280e078ef558b95bf5b6895f6"}, - {file = "SQLAlchemy-1.4.49-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:03db81b89fe7ef3857b4a00b63dedd632d6183d4ea5a31c5d8a92e000a41fc71"}, - {file = "SQLAlchemy-1.4.49-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:95b9df9afd680b7a3b13b38adf6e3a38995da5e162cc7524ef08e3be4e5ed3e1"}, - {file = "SQLAlchemy-1.4.49-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a63e43bf3f668c11bb0444ce6e809c1227b8f067ca1068898f3008a273f52b09"}, - {file = "SQLAlchemy-1.4.49-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f835c050ebaa4e48b18403bed2c0fda986525896efd76c245bdd4db995e51a4c"}, - {file = "SQLAlchemy-1.4.49-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c21b172dfb22e0db303ff6419451f0cac891d2e911bb9fbf8003d717f1bcf91"}, - {file = "SQLAlchemy-1.4.49-cp310-cp310-win32.whl", hash = "sha256:5fb1ebdfc8373b5a291485757bd6431de8d7ed42c27439f543c81f6c8febd729"}, - {file = "SQLAlchemy-1.4.49-cp310-cp310-win_amd64.whl", hash = "sha256:f8a65990c9c490f4651b5c02abccc9f113a7f56fa482031ac8cb88b70bc8ccaa"}, - {file = "SQLAlchemy-1.4.49-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8923dfdf24d5aa8a3adb59723f54118dd4fe62cf59ed0d0d65d940579c1170a4"}, - {file = "SQLAlchemy-1.4.49-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9ab2c507a7a439f13ca4499db6d3f50423d1d65dc9b5ed897e70941d9e135b0"}, - {file = "SQLAlchemy-1.4.49-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5debe7d49b8acf1f3035317e63d9ec8d5e4d904c6e75a2a9246a119f5f2fdf3d"}, - {file = "SQLAlchemy-1.4.49-cp311-cp311-win32.whl", hash = "sha256:82b08e82da3756765c2e75f327b9bf6b0f043c9c3925fb95fb51e1567fa4ee87"}, - {file = "SQLAlchemy-1.4.49-cp311-cp311-win_amd64.whl", hash = "sha256:171e04eeb5d1c0d96a544caf982621a1711d078dbc5c96f11d6469169bd003f1"}, - {file = "SQLAlchemy-1.4.49-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:36e58f8c4fe43984384e3fbe6341ac99b6b4e083de2fe838f0fdb91cebe9e9cb"}, - {file = "SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b31e67ff419013f99ad6f8fc73ee19ea31585e1e9fe773744c0f3ce58c039c30"}, - {file = "SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c14b29d9e1529f99efd550cd04dbb6db6ba5d690abb96d52de2bff4ed518bc95"}, - {file = "SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c40f3470e084d31247aea228aa1c39bbc0904c2b9ccbf5d3cfa2ea2dac06f26d"}, - {file = "SQLAlchemy-1.4.49-cp36-cp36m-win32.whl", hash = "sha256:706bfa02157b97c136547c406f263e4c6274a7b061b3eb9742915dd774bbc264"}, - {file = "SQLAlchemy-1.4.49-cp36-cp36m-win_amd64.whl", hash = "sha256:a7f7b5c07ae5c0cfd24c2db86071fb2a3d947da7bd487e359cc91e67ac1c6d2e"}, - {file = "SQLAlchemy-1.4.49-cp37-cp37m-macosx_11_0_x86_64.whl", hash = "sha256:4afbbf5ef41ac18e02c8dc1f86c04b22b7a2125f2a030e25bbb4aff31abb224b"}, - {file = "SQLAlchemy-1.4.49-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:24e300c0c2147484a002b175f4e1361f102e82c345bf263242f0449672a4bccf"}, - {file = "SQLAlchemy-1.4.49-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:201de072b818f8ad55c80d18d1a788729cccf9be6d9dc3b9d8613b053cd4836d"}, - {file = "SQLAlchemy-1.4.49-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7653ed6817c710d0c95558232aba799307d14ae084cc9b1f4c389157ec50df5c"}, - {file = "SQLAlchemy-1.4.49-cp37-cp37m-win32.whl", hash = "sha256:647e0b309cb4512b1f1b78471fdaf72921b6fa6e750b9f891e09c6e2f0e5326f"}, - {file = "SQLAlchemy-1.4.49-cp37-cp37m-win_amd64.whl", hash = "sha256:ab73ed1a05ff539afc4a7f8cf371764cdf79768ecb7d2ec691e3ff89abbc541e"}, - {file = "SQLAlchemy-1.4.49-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:37ce517c011560d68f1ffb28af65d7e06f873f191eb3a73af5671e9c3fada08a"}, - {file = "SQLAlchemy-1.4.49-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1878ce508edea4a879015ab5215546c444233881301e97ca16fe251e89f1c55"}, - {file = "SQLAlchemy-1.4.49-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0e8e608983e6f85d0852ca61f97e521b62e67969e6e640fe6c6b575d4db68557"}, - {file = "SQLAlchemy-1.4.49-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ccf956da45290df6e809ea12c54c02ace7f8ff4d765d6d3dfb3655ee876ce58d"}, - {file = "SQLAlchemy-1.4.49-cp38-cp38-win32.whl", hash = "sha256:f167c8175ab908ce48bd6550679cc6ea20ae169379e73c7720a28f89e53aa532"}, - {file = "SQLAlchemy-1.4.49-cp38-cp38-win_amd64.whl", hash = "sha256:45806315aae81a0c202752558f0df52b42d11dd7ba0097bf71e253b4215f34f4"}, - {file = "SQLAlchemy-1.4.49-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:b6d0c4b15d65087738a6e22e0ff461b407533ff65a73b818089efc8eb2b3e1de"}, - {file = "SQLAlchemy-1.4.49-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a843e34abfd4c797018fd8d00ffffa99fd5184c421f190b6ca99def4087689bd"}, - {file = "SQLAlchemy-1.4.49-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1c890421651b45a681181301b3497e4d57c0d01dc001e10438a40e9a9c25ee77"}, - {file = "SQLAlchemy-1.4.49-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d26f280b8f0a8f497bc10573849ad6dc62e671d2468826e5c748d04ed9e670d5"}, - {file = "SQLAlchemy-1.4.49-cp39-cp39-win32.whl", hash = "sha256:ec2268de67f73b43320383947e74700e95c6770d0c68c4e615e9897e46296294"}, - {file = "SQLAlchemy-1.4.49-cp39-cp39-win_amd64.whl", hash = "sha256:bbdf16372859b8ed3f4d05f925a984771cd2abd18bd187042f24be4886c2a15f"}, - {file = "SQLAlchemy-1.4.49.tar.gz", hash = "sha256:06ff25cbae30c396c4b7737464f2a7fc37a67b7da409993b182b024cec80aed9"}, -] - -[package.dependencies] -greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"win32\" or platform_machine == \"WIN32\" or platform_machine == \"AMD64\" or platform_machine == \"amd64\" or platform_machine == \"x86_64\" or platform_machine == \"ppc64le\" or platform_machine == \"aarch64\")"} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - -[package.extras] -aiomysql = ["aiomysql", "greenlet (!=0.4.17)"] -aiosqlite = ["aiosqlite", "greenlet (!=0.4.17)", "typing-extensions (!=3.10.0.1)"] -asyncio = ["greenlet (!=0.4.17)"] -asyncmy = ["asyncmy (>=0.2.3,!=0.2.4)", "greenlet (!=0.4.17)"] -mariadb-connector = ["mariadb (>=1.0.1,!=1.1.2)"] -mssql = ["pyodbc"] -mssql-pymssql = ["pymssql"] -mssql-pyodbc = ["pyodbc"] -mypy = ["mypy (>=0.910)", "sqlalchemy2-stubs"] -mysql = ["mysqlclient (>=1.4.0)", "mysqlclient (>=1.4.0,<2)"] -mysql-connector = ["mysql-connector-python"] -oracle = ["cx-oracle (>=7)", "cx-oracle (>=7,<8)"] -postgresql = ["psycopg2 (>=2.7)"] -postgresql-asyncpg = ["asyncpg", "greenlet (!=0.4.17)"] -postgresql-pg8000 = ["pg8000 (>=1.16.6,!=1.29.0)"] -postgresql-psycopg2binary = ["psycopg2-binary"] -postgresql-psycopg2cffi = ["psycopg2cffi"] -pymysql = ["pymysql", "pymysql (<1)"] -sqlcipher = ["sqlcipher3-binary"] - -[[package]] -name = "taos-ws-py" -version = "0.2.5" -description = "" -optional = true -python-versions = "*" -files = [ - {file = "taos_ws_py-0.2.5-cp37-abi3-macosx_10_7_x86_64.whl", hash = "sha256:30b97412315a85db12cc425bb28c2a5b0780c1f422850600f0bfcf8bcb1b73b7"}, - {file = "taos_ws_py-0.2.5-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:833e1ca622cb06bdb6efb9436cae34dc36b8a3abae7deca5c7725b77b0cbc5cb"}, - {file = "taos_ws_py-0.2.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f75c228082d5047dbc2e24567f40556eedf518a8209fb7d5232c991d78cc5e5"}, - {file = "taos_ws_py-0.2.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:57e84549f6e5104b09f200aafb6eb3c2b109b516e5583f187aa8183e9893d7e0"}, - {file = "taos_ws_py-0.2.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:36c6c5e94e72904b6f0cc97f13d24c27ad85b3556b92fe5140eecf018bc9c723"}, - {file = "taos_ws_py-0.2.5-cp37-abi3-win_amd64.whl", hash = "sha256:f6ddb4c41c476022c2ef5a9d92b9c83e9f81293fc6caa2844e93dfd06c220990"}, -] - -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -files = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] - -[[package]] -name = "tomli" -version = "1.2.3" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.6" -files = [ - {file = "tomli-1.2.3-py3-none-any.whl", hash = "sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c"}, - {file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"}, -] - -[[package]] -name = "typed-ast" -version = "1.4.3" -description = "a fork of Python 2 and 3 ast modules with type comment support" -optional = false -python-versions = "*" -files = [ - {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9a40cf33902eba6"}, - {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:c907f561b1e83e93fad565bac5ba9c22d96a54e7ea0267c708bffe863cbe4075"}, - {file = "typed_ast-1.4.3-cp35-cp35m-manylinux2014_aarch64.whl", hash = "sha256:1b3ead4a96c9101bef08f9f7d1217c096f31667617b58de957f690c92378b528"}, - {file = "typed_ast-1.4.3-cp35-cp35m-win32.whl", hash = "sha256:dde816ca9dac1d9c01dd504ea5967821606f02e510438120091b84e852367428"}, - {file = "typed_ast-1.4.3-cp35-cp35m-win_amd64.whl", hash = "sha256:777a26c84bea6cd934422ac2e3b78863a37017618b6e5c08f92ef69853e765d3"}, - {file = "typed_ast-1.4.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f8afcf15cc511ada719a88e013cec87c11aff7b91f019295eb4530f96fe5ef2f"}, - {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:52b1eb8c83f178ab787f3a4283f68258525f8d70f778a2f6dd54d3b5e5fb4341"}, - {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:01ae5f73431d21eead5015997ab41afa53aa1fbe252f9da060be5dad2c730ace"}, - {file = "typed_ast-1.4.3-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:c190f0899e9f9f8b6b7863debfb739abcb21a5c054f911ca3596d12b8a4c4c7f"}, - {file = "typed_ast-1.4.3-cp36-cp36m-win32.whl", hash = "sha256:398e44cd480f4d2b7ee8d98385ca104e35c81525dd98c519acff1b79bdaac363"}, - {file = "typed_ast-1.4.3-cp36-cp36m-win_amd64.whl", hash = "sha256:bff6ad71c81b3bba8fa35f0f1921fb24ff4476235a6e94a26ada2e54370e6da7"}, - {file = "typed_ast-1.4.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0fb71b8c643187d7492c1f8352f2c15b4c4af3f6338f21681d3681b3dc31a266"}, - {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:760ad187b1041a154f0e4d0f6aae3e40fdb51d6de16e5c99aedadd9246450e9e"}, - {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5feca99c17af94057417d744607b82dd0a664fd5e4ca98061480fd8b14b18d04"}, - {file = "typed_ast-1.4.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:95431a26309a21874005845c21118c83991c63ea800dd44843e42a916aec5899"}, - {file = "typed_ast-1.4.3-cp37-cp37m-win32.whl", hash = "sha256:aee0c1256be6c07bd3e1263ff920c325b59849dc95392a05f258bb9b259cf39c"}, - {file = "typed_ast-1.4.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9ad2c92ec681e02baf81fdfa056fe0d818645efa9af1f1cd5fd6f1bd2bdfd805"}, - {file = "typed_ast-1.4.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b36b4f3920103a25e1d5d024d155c504080959582b928e91cb608a65c3a49e1a"}, - {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:067a74454df670dcaa4e59349a2e5c81e567d8d65458d480a5b3dfecec08c5ff"}, - {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7538e495704e2ccda9b234b82423a4038f324f3a10c43bc088a1636180f11a41"}, - {file = "typed_ast-1.4.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:af3d4a73793725138d6b334d9d247ce7e5f084d96284ed23f22ee626a7b88e39"}, - {file = "typed_ast-1.4.3-cp38-cp38-win32.whl", hash = "sha256:f2362f3cb0f3172c42938946dbc5b7843c2a28aec307c49100c8b38764eb6927"}, - {file = "typed_ast-1.4.3-cp38-cp38-win_amd64.whl", hash = "sha256:dd4a21253f42b8d2b48410cb31fe501d32f8b9fbeb1f55063ad102fe9c425e40"}, - {file = "typed_ast-1.4.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f328adcfebed9f11301eaedfa48e15bdece9b519fb27e6a8c01aa52a17ec31b3"}, - {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:2c726c276d09fc5c414693a2de063f521052d9ea7c240ce553316f70656c84d4"}, - {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:cae53c389825d3b46fb37538441f75d6aecc4174f615d048321b716df2757fb0"}, - {file = "typed_ast-1.4.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:b9574c6f03f685070d859e75c7f9eeca02d6933273b5e69572e5ff9d5e3931c3"}, - {file = "typed_ast-1.4.3-cp39-cp39-win32.whl", hash = "sha256:209596a4ec71d990d71d5e0d312ac935d86930e6eecff6ccc7007fe54d703808"}, - {file = "typed_ast-1.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:9c6d1a54552b5330bc657b7ef0eae25d00ba7ffe85d9ea8ae6540d2197a3788c"}, - {file = "typed_ast-1.4.3.tar.gz", hash = "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65"}, -] - -[[package]] -name = "typing" -version = "3.7.4.3" -description = "Type Hints for Python" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "typing-3.7.4.3-py2-none-any.whl", hash = "sha256:283d868f5071ab9ad873e5e52268d611e851c870a2ba354193026f2dfb29d8b5"}, - {file = "typing-3.7.4.3.tar.gz", hash = "sha256:1187fb9c82fd670d10aa07bbb6cfcfe4bdda42d6fab8d5134f04e8c4d0b71cc9"}, -] - -[[package]] -name = "typing-extensions" -version = "4.1.1" -description = "Backported and Experimental Type Hints for Python 3.6+" -optional = false -python-versions = ">=3.6" -files = [ - {file = "typing_extensions-4.1.1-py3-none-any.whl", hash = "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2"}, - {file = "typing_extensions-4.1.1.tar.gz", hash = "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42"}, -] - -[[package]] -name = "tzdata" -version = "2023.3" -description = "Provider of IANA time zone data" -optional = false -python-versions = ">=2" -files = [ - {file = "tzdata-2023.3-py2.py3-none-any.whl", hash = "sha256:7e65763eef3120314099b6939b5546db7adce1e7d6f2e179e3df563c70511eda"}, - {file = "tzdata-2023.3.tar.gz", hash = "sha256:11ef1e08e54acb0d4f95bdb1be05da659673de4acbd21bf9c69e94cc5e907a3a"}, -] - -[[package]] -name = "urllib3" -version = "1.26.16" -description = "HTTP library with thread-safe connection pooling, file post, and more." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" -files = [ - {file = "urllib3-1.26.16-py2.py3-none-any.whl", hash = "sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f"}, - {file = "urllib3-1.26.16.tar.gz", hash = "sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14"}, -] - -[package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] -secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] - -[[package]] -name = "zipp" -version = "3.15.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.7" -files = [ - {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, - {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] - -[extras] -ws = ["taos-ws-py"] - -[metadata] -lock-version = "2.0" -python-versions = ">=3.6.2,<4.0" -content-hash = "b362f9a0f7d50c4f901624e667b3ad2f16050d90343caafc82180b462e23ecf6" diff --git a/temp b/temp deleted file mode 100644 index 922490a9..00000000 --- a/temp +++ /dev/null @@ -1,30 +0,0 @@ -cdef extern from "taos.h": - ctypedef bool - ctypedef int32_t - ctypedef void TAOS_RES - bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col) - -from taos._cinterface cimport taos_is_null, TAOS_RES, bool, int32_t - - -cpdef taos_get_column_data_is_null(size_t result, int32_t field, int32_t rows): - is_null = [] - cdef TAOS_RES* res = result - cdef int32_t i - for i in range(rows): - is_null.append(taos_is_null(res, i, field)) - - return is_null - - c_string = (ptr + offsets[i] + sizeof(unsigned short)) - py_bytes_string = c_string[:rbyte] - res.append(py_bytes_string.decode("utf-8")) - - -"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:taos/taos_raw/libs /LIBPATH:C:\Users\lighthorse\anaconda3\envs\taos_env\libs /LIBPATH:C:\Users\lighthorse\anaconda3\envs\taos_env /LIBPATH:C:\Users\lighthorse\anaconda3\envs\taos_env\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" taos.lib /EXPORT:PyInit__cinterface E:\soure_code\taos-connector-python\build\temp.win-amd64-cpython-310\Release\taos/_cinterface.obj /OUT:E:\soure_code\taos-connector-python\build\lib.win-amd64-cpython-310\taos\_cinterface.cp310-win_amd64.pyd /IMPLIB:E:\soure_code\taos-connector-python\build\temp.win-amd64-cpython-310\Release\taos\_cinterface.cp310-win_amd64.lib - -from taos._objects import TaosConnection -conn = TaosConnection(host="localhost", user="root", password="taosdata", database="lhdata", port=6030, timezone="Asia/Shanghai", config="C:\TDengine\cfg") -%%prun -s cumulative -tr = conn.query("SELECT * FROM daily_bar WHERE symbol = '000001 CH Equity'") -data = tr.fetch_all() \ No newline at end of file From bafaa6e1f77f6e69b3c75d986210f01fcbb45cc6 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Fri, 25 Aug 2023 17:55:28 +0800 Subject: [PATCH 09/31] modify .gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4491eaf5..99b57319 100644 --- a/.gitignore +++ b/.gitignore @@ -158,4 +158,6 @@ setup.py docs *.swp *~ -.env \ No newline at end of file +.env +taos/*.c +taos/*.cpp \ No newline at end of file From b540257ca9feaeccb42d7688f3f4d4ccaa3a6725 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Mon, 28 Aug 2023 17:56:27 +0800 Subject: [PATCH 10/31] perf: using cython 1. add async function --- taos/_objects.pyx | 199 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 159 insertions(+), 40 deletions(-) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index bafddb9e..8e231a52 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -1,5 +1,6 @@ # cython: profile=True +import asyncio from typing import Optional from taos._cinterface cimport * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string @@ -25,22 +26,44 @@ def set_tz(tz): _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) -cdef void async_callback_wrapper(void *param, TAOS_RES *res, int code) nogil: +cdef void async_result_future_wrapper(void *param, TAOS_RES *res, int code) nogil: with gil: - callback = param - print("callback:", callback, res, code) - dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - fields = taos_fetch_fields(res) - field_count = taos_field_count(res) - taos_fields = [TaosField((f.name).decode("utf-8"), f.type, f.bytes) for f in fields[:field_count]] - block, num_of_rows = taos_fetch_block_v3(res, fields, field_count, dt_epoch) - errno = taos_errno(res) + fut = param + print("callback:", fut, res, code) + if code != 0: + e = ProgrammingError(taos_errstr(res), code) + fut.get_loop().call_soon_threadsafe(fut.set_exception, e) + else: + taos_result = TaosResult(res) + fut.get_loop().call_soon_threadsafe(fut.set_result, taos_result) - if errno != 0: - raise ProgrammingError(taos_errstr(res), errno) - for row in map(tuple, zip(*block)): - callback(row, taos_fields) +cdef void async_rows_future_wrapper(void *param, TAOS_RES *res, int num_of_rows) nogil: + cdef int i = 0 + with gil: + taos_result, fut = param + print("callback:", taos_result, fut, res, num_of_rows) + rows = [] + if num_of_rows > 0: + for row in taos_result.rows_iter(): + rows.append(row) + i += 1 + if i >= num_of_rows: + break + + fut.get_loop().call_soon_threadsafe(fut.set_result, rows) + + +cdef void async_block_future_wrapper(void *param, TAOS_RES *res, int num_of_rows) nogil: + cdef int i = 0 + with gil: + taos_result, fut = param + print("callback:", taos_result, fut, res, num_of_rows) + block, n = [], 0 + if num_of_rows > 0: + block, n = taos_result.fetch_block() + + fut.get_loop().call_soon_threadsafe(fut.set_result, (block, n)) cdef class TaosConnection: @@ -106,11 +129,6 @@ cdef class TaosConnection: def __dealloc__(self): self.close() - def close(self): - if self._raw_conn is not NULL: - taos_close(self._raw_conn) - self._raw_conn = NULL - @property def client_info(self): return taos_get_client_info().decode("utf-8") @@ -140,12 +158,17 @@ cdef class TaosConnection: return TaosResult(res) - def query_a(self, sql: str, callback, req_id: Optional[int] = None): + async def query_async(self, sql: str, req_id: Optional[int] = None): + loop = asyncio.get_event_loop() _sql = sql.encode("utf-8") + fut = loop.create_future() if req_id is None: - taos_query_a(self._raw_conn, _sql, async_callback_wrapper, callback) + taos_query_a(self._raw_conn, _sql, async_result_future_wrapper, fut) else: - taos_query_a_with_reqid(self._raw_conn, _sql, async_callback_wrapper, callback, req_id) + taos_query_a_with_reqid(self._raw_conn, _sql, async_result_future_wrapper, fut, req_id) + + res = await fut + return res def subscribe(self, configs: dict[str, str], callback): if self._raw_conn is NULL: @@ -163,6 +186,11 @@ cdef class TaosConnection: _tables = ",".join(tables).encode("utf-8") taos_load_table_info(self._raw_conn, _tables) + def close(self): + if self._raw_conn is not NULL: + taos_close(self._raw_conn) + self._raw_conn = NULL + def commit(self): """Commit any pending transaction to the database. @@ -174,6 +202,9 @@ cdef class TaosConnection: """Void functionality""" pass + def cursor(self): + return TaosCursor(self) + def clear_result_set(self): """Clear unused result set on this connection.""" pass @@ -358,6 +389,7 @@ cdef class TaosResult: cdef TAOS_ROW taos_row cdef int i + cdef int[1] offsets = [-2] dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch is_null = [False] @@ -370,10 +402,8 @@ cdef class TaosResult: for i in range(self._field_count): data = taos_row[i] field = self._fields[i] - if field.type in (TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_VARBINARY): - row[i] = _parse_binary_string(data, 1, field.bytes)[0] - elif field.type in (TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_VARCHAR): - row[i] = _parse_nchar_string(data, 1, field.bytes)[0] + if field.type in UNSIZED_TYPE: + row[i] = _parse_string(data, 1, offsets)[0] elif field.type in SIZED_TYPE: row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): @@ -396,11 +426,39 @@ cdef class TaosResult: yield [r for r in map(tuple, zip(*block))], num_of_rows - def fetch_rows_a(self, callback): - taos_fetch_rows_a(self._res, async_callback_wrapper, callback) + async def rows_iter_a(self): + if self._res is NULL: + raise OperationalError("Invalid use of rows_iter_a") - def taos_fetch_raw_block_a(self, callback): - taos_fetch_raw_block_a(self._res, async_callback_wrapper, callback) + loop = asyncio.get_event_loop() + while True: + fut = loop.create_future() + param = (self, fut) + taos_fetch_rows_a(self._res, async_rows_future_wrapper, param) + + rows = await fut + if not rows: + break + + for row in rows: + yield row + + async def blocks_iter_a(self): + if self._res is NULL: + raise OperationalError("Invalid use of blocks_iter_a") + + loop = asyncio.get_event_loop() + while True: + fut = loop.create_future() + param = (self, fut) + taos_fetch_rows_a(self._res, async_block_future_wrapper, param) + # taos_fetch_raw_block_a(self._res, async_block_future_wrapper, param) + + block, n = await fut + if not block: + break + + yield block, n def __dealloc__(self): if self._res is not NULL: @@ -421,10 +479,13 @@ cdef class TaosCursor: self._result = None def __iter__(self): - for block, num_of_rows in self._result.blocks_iter(): + for block, _ in self._result.blocks_iter(): for row in block: yield row + def next(self): + return next(self) + @property def description(self): return self._description @@ -438,30 +499,88 @@ cdef class TaosCursor: """Return the rowcount of insertion""" return self._result.affected_rows - def execute(self, sql, params=None, req_id: Optional[int] = None): + def callproc(self, procname, *args): + """Call a stored database procedure with the given name. + + Void functionality since no stored procedures. + """ + pass + + def close(self): + if self._connection is None: + return False + + self._reset_result() + self._connection = None + + return True + + def execute(self, operation, params=None, req_id: Optional[int] = None): """Prepare and execute a database operation (query or command).""" + if not operation: + return + if not self._connection: raise ProgrammingError("Cursor is not connected") self._reset_result() - + sql = operation self._result = self._connection.query(sql, req_id) self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] + if self._result.field_count == 0: + return self.affected_rows + else: + return self._result + + def execute_many(self, operation, data_list, req_id: Optional[int] = None): + """ + Prepare a database operation (query or command) and then execute it against all parameter sequences or mappings + found in the sequence seq_of_parameters. + """ + sql = operation + flag = True + affected_rows = 0 + for line in data_list: + if isinstance(line, dict): + flag = False + # print(f'execute: {sql.format(**line)}') + affected_rows += self.execute(sql.format(**line), req_id=req_id) + elif isinstance(line, list): + sql += f' {tuple(line)} ' + elif isinstance(line, tuple): + sql += f' {line} ' + if flag: + # print(f'execute_many: {sql}') + affected_rows += self.execute(sql, req_id=req_id) + return affected_rows + def fetchone(self): - return next(self) + try: + row = next(self) + except StopIteration: + row = None + return row + + def fetchmany(self, size=None): + size = size or 1 + rows = [] + for row in self: + rows.append(row) + + return rows def fetchall(self): return [r for r in self] - - def close(self): - if self._connection is None: - return False - self._reset_result() - self._connection = None + def nextset(self): + pass - return True + def setinputsize(self, sizes): + pass + + def setutputsize(self, size, column=None): + pass def _reset_result(self): """Reset the result to unused version.""" From 4ab9f51b9d1f37256fc7177d973eeccca5c7aa82 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Mon, 28 Aug 2023 18:23:32 +0800 Subject: [PATCH 11/31] fix cursor execute --- taos/_objects.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 8e231a52..33f7aee0 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -526,7 +526,7 @@ cdef class TaosCursor: self._reset_result() sql = operation self._result = self._connection.query(sql, req_id) - self._description = [(f.name.decode("utf-8"), f.type, None, None, None, None, False) for f in self._result.fields] + self._description = [(f.name, f.type, None, None, None, None, False) for f in self._result.fields] if self._result.field_count == 0: return self.affected_rows From 9fe89a34f39ef56ef677c072ea9ac869c37deaea Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Tue, 29 Aug 2023 11:08:49 +0800 Subject: [PATCH 12/31] perf: using cython 1. better exception --- taos/_objects.pyx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 33f7aee0..412b2729 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -29,7 +29,6 @@ def set_tz(tz): cdef void async_result_future_wrapper(void *param, TAOS_RES *res, int code) nogil: with gil: fut = param - print("callback:", fut, res, code) if code != 0: e = ProgrammingError(taos_errstr(res), code) fut.get_loop().call_soon_threadsafe(fut.set_exception, e) @@ -42,7 +41,6 @@ cdef void async_rows_future_wrapper(void *param, TAOS_RES *res, int num_of_rows) cdef int i = 0 with gil: taos_result, fut = param - print("callback:", taos_result, fut, res, num_of_rows) rows = [] if num_of_rows > 0: for row in taos_result.rows_iter(): @@ -58,7 +56,6 @@ cdef void async_block_future_wrapper(void *param, TAOS_RES *res, int num_of_rows cdef int i = 0 with gil: taos_result, fut = param - print("callback:", taos_result, fut, res, num_of_rows) block, n = [], 0 if num_of_rows > 0: block, n = taos_result.fetch_block() @@ -179,10 +176,8 @@ cdef class TaosConnection: _k = k.encode("utf-8") _v = v.encode("utf-8") tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) - print("tmq_conf_res:", tmq_conf_res) def load_table_info(self, tables: list): - # type: (str) -> None _tables = ",".join(tables).encode("utf-8") taos_load_table_info(self._raw_conn, _tables) @@ -544,14 +539,12 @@ cdef class TaosCursor: for line in data_list: if isinstance(line, dict): flag = False - # print(f'execute: {sql.format(**line)}') affected_rows += self.execute(sql.format(**line), req_id=req_id) elif isinstance(line, list): sql += f' {tuple(line)} ' elif isinstance(line, tuple): sql += f' {line} ' if flag: - # print(f'execute_many: {sql}') affected_rows += self.execute(sql, req_id=req_id) return affected_rows @@ -628,6 +621,9 @@ cdef class TaosConsumer: def __cinit__(self, configs: dict[str, str]): self._configs = configs self._tmq_conf = tmq_conf_new() + if self._tmq_conf: + raise TmqError("new tmq conf failed") + for k, v in self._configs.items(): _k = k.encode("utf-8") _v = v.encode("utf-8") @@ -635,16 +631,16 @@ cdef class TaosConsumer: if tmq_conf_res != tmq_conf_res_t.TMQ_CONF_OK: tmq_conf_destroy(self._tmq_conf) self._tmq_conf = NULL - raise Exception("set up tmq config failed!") + raise TmqError("set tmq conf failed!") self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) if self._tmq is NULL: - raise Exception("setup tmq failed") + raise TmqError("new tmq consumer failed") def subscribe(self, topics: list[str]): tmq_list = tmq_list_new() if tmq_list is NULL: - raise Exception("set up tmq list failed!") + raise TmqError("new tmq list failed!") for tp in topics: _tp = tp.encode("utf-8") From 66a42c0fed83709192766e5564d1fe46298c91ce Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Tue, 29 Aug 2023 12:01:32 +0800 Subject: [PATCH 13/31] perf: using cython 1. add async commit --- taos/_cinterface.pxd | 4 ++++ taos/_objects.pyx | 47 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index eba97cf7..496b8809 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -97,6 +97,8 @@ cdef extern from "taos.h": ctypedef struct tmq_list_t: pass + ctypedef void tmq_commit_cb(tmq_t *tmq, int32_t code, void *param) except * + ctypedef enum tmq_conf_res_t: TMQ_CONF_UNKNOWN TMQ_CONF_INVALID @@ -125,6 +127,8 @@ cdef extern from "taos.h": int32_t tmq_consumer_close(tmq_t *tmq) int32_t tmq_commit_sync(tmq_t *tmq, const TAOS_RES *msg) int32_t tmq_commit_offset_sync(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset) + void tmq_commit_async(tmq_t *tmq, const TAOS_RES *msg, tmq_commit_cb *cb, void *param) + void tmq_commit_offset_async(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset, tmq_commit_cb *cb, void *param) int32_t tmq_get_topic_assignment(tmq_t *tmq, const char *pTopicName, tmq_topic_assignment **assignment,int32_t *numOfAssignment) void tmq_free_assignment(tmq_topic_assignment* pAssignment) int32_t tmq_offset_seek(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 412b2729..2655789f 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -613,6 +613,14 @@ cdef class TaosTopicAssignment: return self._end +# ---------------------------------------- TMQ --------------------------------------------------------------- v + +cdef void async_commit_future_wrapper(tmq_t *tmq, int32_t code, void *param) nogil: + with gil: + fut = param + fut.get_loop().call_soon_threadsafe(fut.set_result, code) + + cdef class TaosConsumer: cdef dict _configs cdef tmq_conf_t *_tmq_conf @@ -659,6 +667,16 @@ cdef class TaosConsumer: if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + def close(self): + if self._tmq_conf is not NULL: + tmq_conf_destroy(self._tmq_conf) + self._tmq_conf = NULL + + if self._tmq is not NULL: + tmq_unsubscribe(self._tmq) + tmq_consumer_close(self._tmq) + self._tmq = NULL + def poll(self, timeout: int): res = tmq_consumer_poll(self._tmq, timeout) if res is NULL: @@ -669,16 +687,36 @@ cdef class TaosConsumer: def commit(self, taos_res: TaosResult): self.result_commit(taos_res) + async def commit_a(self, taos_res: TaosResult): + await self.result_commit_a(taos_res) + def result_commit(self, taos_res: TaosResult): tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + async def result_commit_a(self, taos_res: TaosResult): + loop = asyncio.get_event_loop() + fut = loop.create_future() + tmq_commit_async(self._tmq, taos_res._res, async_commit_future_wrapper, fut) + tmq_errno = await fut + if tmq_errno != 0: + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + def offset_commit(self, topic: str, vg_id: int, offset: int): _topic = topic.encode("utf-8") tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + async def offset_commit_a(self, topic: str, vg_id: int, offset: int): + loop = asyncio.get_event_loop() + fut = loop.create_future() + _topic = topic.encode("utf-8") + tmq_commit_offset_async(self._tmq, _topic, vg_id, offset, async_commit_future_wrapper, fut) + tmq_errno = await fut + if tmq_errno != 0: + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) def get_topic_assignment(self, topic: str): cdef int32_t num_of_assignment @@ -738,14 +776,9 @@ cdef class TaosConsumer: return tmq_get_vgroup_offset(taos_res._res) def __dealloc__(self): - if self._tmq_conf is not NULL: - tmq_conf_destroy(self._tmq_conf) - self._tmq_conf = NULL - - if self._tmq is not NULL: - tmq_consumer_close(self._tmq) - self._tmq = NULL + self.close() +# ---------------------------------------- TMQ --------------------------------------------------------------- ^ # class TaosStmt(object): # cdef TAOS_STMT *_stmt From 6bdeb4baf7cc0fc05b47f9bda197e7294ad7cfd7 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Tue, 29 Aug 2023 20:00:40 +0800 Subject: [PATCH 14/31] perf: using cython 1. TopicPartition 2. TaosConsumer --- taos/_cinterface.pxd | 1 + taos/_objects.pyx | 199 +++++++++++++++++++++++++++++++------------ 2 files changed, 144 insertions(+), 56 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 496b8809..4c9c5ffc 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -123,6 +123,7 @@ cdef extern from "taos.h": tmq_t *tmq_consumer_new(tmq_conf_t *conf, char *errstr, int32_t errstrLen) int32_t tmq_subscribe(tmq_t *tmq, const tmq_list_t *topic_list) int32_t tmq_unsubscribe(tmq_t *tmq) + int32_t tmq_subscription(tmq_t *tmq, tmq_list_t **topics) TAOS_RES *tmq_consumer_poll(tmq_t *tmq, int64_t timeout) int32_t tmq_consumer_close(tmq_t *tmq) int32_t tmq_commit_sync(tmq_t *tmq, const TAOS_RES *msg) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 2655789f..449dc95b 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -91,7 +91,7 @@ cdef class TaosConnection: self._database = database if port: - self._port = port + self._port = port or 0 if timezone: timezone = timezone.encode("utf-8") @@ -107,8 +107,7 @@ cdef class TaosConnection: def _init_options(self): if self._tz: - tz = self._tz - set_tz(pytz.timezone(tz.decode("utf-8"))) + set_tz(pytz.timezone(self._tz.decode("utf-8"))) taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) if self._config: @@ -584,25 +583,39 @@ cdef class TaosCursor: self.close() -cdef class TaosTopicAssignment: - cdef int32_t _vg_id - cdef int64_t _current_offset +# ---------------------------------------- TMQ --------------------------------------------------------------- v +cdef void async_commit_future_wrapper(tmq_t *tmq, int32_t code, void *param) nogil: + with gil: + fut = param + fut.get_loop().call_soon_threadsafe(fut.set_result, code) + + +cdef class TopicPartition: + cdef char *_topic + cdef int32_t _partition + cdef int64_t _offset cdef int64_t _begin cdef int64_t _end - def __cinit__(self, int32_t vg_id, int64_t current_offset, int64_t begin, int64_t end): - self._vg_id = vg_id - self._current_offset = current_offset + def __cinit__(self, str topic, int32_t partition, int64_t offset, int64_t begin, int64_t end): + _topic = topic.encode("utf-8") + self._topic = _topic + self._partition = partition + self._offset = offset self._begin = begin self._end = end @property - def vg_id(self): - return self._vg_id + def topic(self): + return self._topic.decode("utf-8") + + @property + def partition(self): + return self._partition @property - def current_offset(self): - return self._current_offset + def offset(self): + return self._offset @property def begin(self): @@ -613,20 +626,37 @@ cdef class TaosTopicAssignment: return self._end -# ---------------------------------------- TMQ --------------------------------------------------------------- v - -cdef void async_commit_future_wrapper(tmq_t *tmq, int32_t code, void *param) nogil: - with gil: - fut = param - fut.get_loop().call_soon_threadsafe(fut.set_result, code) - - cdef class TaosConsumer: cdef dict _configs cdef tmq_conf_t *_tmq_conf cdef tmq_t *_tmq + cdef bool _subscribed + default_config = { + 'group.id', + 'client.id', + 'msg.with.table.name', + 'enable.auto.commit', + 'auto.commit.interval.ms', + 'auto.offset.reset', + 'experimental.snapshot.enable', + 'enable.heartbeat.background', + 'experimental.snapshot.batch.size', + 'td.connect.ip', + 'td.connect.user', + 'td.connect.pass', + 'td.connect.port', + 'td.connect.db', + } def __cinit__(self, configs: dict[str, str]): + self._init_config() + self._init_consumer() + self._subscribed = False + + def _init_config(self, configs: dict[str, str]): + if 'group.id' not in configs: + raise TmqError('missing group.id in consumer config setting') + self._configs = configs self._tmq_conf = tmq_conf_new() if self._tmq_conf: @@ -641,6 +671,10 @@ cdef class TaosConsumer: self._tmq_conf = NULL raise TmqError("set tmq conf failed!") + def _init_consumer(self): + if self._tmq_conf is NULL: + raise TmqError('tmq_conf is NULL') + self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) if self._tmq is NULL: raise TmqError("new tmq consumer failed") @@ -661,11 +695,15 @@ cdef class TaosConsumer: if tmq_errno != 0: tmq_list_destroy(tmq_list) raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + self._subscribed = True def unsubscribe(self): tmq_errno = tmq_unsubscribe(self._tmq) if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + self._subscribed = False def close(self): if self._tmq_conf is not NULL: @@ -677,8 +715,12 @@ cdef class TaosConsumer: tmq_consumer_close(self._tmq) self._tmq = NULL - def poll(self, timeout: int): - res = tmq_consumer_poll(self._tmq, timeout) + def poll(self, float timeout=1.0): + if not self._subscribed: + raise TmqError("unsubscribe topic") + + timeout_ms = int(timeout * 1000) + res = tmq_consumer_poll(self._tmq, timeout_ms) if res is NULL: return None @@ -718,50 +760,95 @@ cdef class TaosConsumer: if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - def get_topic_assignment(self, topic: str): + def assignment(self): + cdef int32_t i cdef int32_t num_of_assignment - cdef tmq_topic_assignment *assignment_ptr = NULL - _topic = topic.encode("utf-8") - tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &assignment_ptr, &num_of_assignment) + cdef tmq_topic_assignment *p_assignment = NULL + + topics = self.list_topics() + topic_partitions = [] + for topic in topics: + _topic = topic.encode("utf-8") + tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &p_assignment, &num_of_assignment) + if tmq_errno != 0: + tmq_free_assignment(p_assignment) + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + for i in range(num_of_assignment): + assignment = p_assignment[i] + tp = TopicPartition(topic, assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) + topic_partitions.append(tp) + + tmq_free_assignment(p_assignment) + + return topic_partitions + + def seek(self, partition: TopicPartition): + """ + Set consume position for partition to offset. + """ + tmq_errno = tmq_offset_seek(self._tmq, partition._topic, partition._partition, partition._offset) if tmq_errno != 0: - tmq_free_assignment(assignment_ptr) raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - cdef tmq_topic_assignment *assignment - topic_assignments = [] - for i in range(num_of_assignment): - assignment = &assignment_ptr[i] - tta = TaosTopicAssignment(assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) - topic_assignments.append(tta) + tmq_offset_seek(self._tmq, partition.topic, partition.partition, partition.offset) + + def committed(self, partitions: list[TopicPartition]) -> list[TopicPartition]: + """ + Retrieve committed offsets for the specified partitions. - tmq_free_assignment(assignment_ptr) + :param list(TopicPartition) partitions: List of topic+partitions to query for stored offsets. + :returns: List of topic+partitions with offset and possibly error set. + :rtype: list(TopicPartition) + """ + for partition in partitions: + if not isinstance(partition, TopicPartition): + raise TmqError(msg='Invalid partition type') + offset = tmq_committed(self._tmq, partition._topic, partition._partition) - return topic_assignments + if offset < 0: + raise TmqError(tmq_err2str(offset), offset) + + partition._offset = offset - def offset_seek(self, topic: str, vg_id: int, offset: int): - _topic = topic.encode("utf-8") - tmq_errno = tmq_offset_seek(self._tmq, _topic, vg_id, offset) + return partitions + + def position(self, partitions: list[TopicPartition]) -> list[TopicPartition]: + """ + Retrieve current positions (offsets) for the specified partitions. + + :param list(TopicPartition) partitions: List of topic+partitions to return current offsets for. + :returns: List of topic+partitions with offset and possibly error set. + :rtype: list(TopicPartition) + """ + for partition in partitions: + if not isinstance(partition, TopicPartition): + raise TmqError(msg='Invalid partition type') + offset = tmq_position(self._tmq, partition._topic, partition._partition) + + if offset < 0: + raise TmqError(tmq_err2str(offset), offset) + + partition._offset = offset + + return partitions + + def list_topics(self): + cdef int i + cdef tmq_list_t *topics + tmq_errno = tmq_subscription(self._tmq, &topics) if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - def position(self, topic: str, vg_id: int): - _topic = topic.encode("utf-8") - pos = tmq_position(self._tmq, _topic, vg_id) - if pos < 0: - raise TmqError(tmq_err2str(pos), pos) - - return pos - - def committed(self, topic: str, vg_id: int): - _topic = topic.encode("utf-8") - offset = tmq_committed(self._tmq, _topic, vg_id) - if offset == -2147467247: - return None - - if offset < 0: - raise TmqError(tmq_err2str(offset), offset) + n = tmq_list_get_size(topics) + ca = tmq_list_to_c_array(topics) + tp_list = [] + for i in range(n): + tp_list.append(ca[i]) + + tmq_list_destroy(topics) - return offset + return tp_list def get_topic_name(self, taos_res: TaosResult): return tmq_get_topic_name(taos_res._res) From 68bf34464f8ba4d38efd2a5fdea989dd985937a3 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Mon, 4 Sep 2023 13:21:03 +0800 Subject: [PATCH 15/31] perf: using cython 1. add Message, MessageBlock --- taos/_cinterface.pxd | 8 ++ taos/_objects.pyx | 200 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 175 insertions(+), 33 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 4c9c5ffc..ec3123d0 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -142,6 +142,14 @@ cdef extern from "taos.h": int64_t tmq_get_vgroup_offset(TAOS_RES* res) const char *tmq_err2str(int32_t code) + ctypedef enum tmq_res_t: + TMQ_RES_INVALID + TMQ_RES_DATA + TMQ_RES_TABLE_META + TMQ_RES_METADATA + + const char *tmq_get_table_name(TAOS_RES *res) + tmq_res_t tmq_get_res_type(TAOS_RES *res) cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows) cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, object dt_epoch) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 449dc95b..6793c89f 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -1,7 +1,7 @@ # cython: profile=True import asyncio -from typing import Optional +from typing import Optional, List from taos._cinterface cimport * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC @@ -597,7 +597,7 @@ cdef class TopicPartition: cdef int64_t _begin cdef int64_t _end - def __cinit__(self, str topic, int32_t partition, int64_t offset, int64_t begin, int64_t end): + def __cinit__(self, str topic, int32_t partition, int64_t offset, int64_t begin=0, int64_t end=0): _topic = topic.encode("utf-8") self._topic = _topic self._partition = partition @@ -626,6 +626,122 @@ cdef class TopicPartition: return self._end +cdef class MessageBlock: + cdef list _block + cdef list _fields + cdef int _nrows + cdef int _ncols + cdef str _table + + def __init__(self, block=None, fields=None, nrows=0, ncols=0, table=""): + self._block = block or [] + self._fields = fields or [] + self._nrows = nrows + self._ncols = ncols + self._table = table + + def fields(self): + return self._fields + + def nrows(self): + return self._nrows + + def ncols(self): + return self._ncols + + def table(self): + return self._table + + def fetchall(self): + return [r for r in self] + + def __iter__(self): + return zip(*self._block) + + +cdef class Message: + cdef TAOS_RES *_res + cdef int _err_no + cdef char *_err_str + + def __cinit__(self, size_t res): + self._res = res + self._err_no = taos_errno(self._res) + self._err_str = taos_errstr(self._res) + + def error(self): + return TmqError(self._err_str) if self._err_no else None + + def topic(self): + return tmq_get_topic_name(self._res) + + def database(self): + return tmq_get_db_name(self._res) + + def vgroup(self): + return tmq_get_vgroup_id(self._res) + + def offset(self): + return tmq_get_vgroup_offset(self._res) + + def _fetch_message_block(self): + cdef TAOS_ROW pblock + num_of_rows = taos_fetch_block(self._res, &pblock) + if num_of_rows == 0: + return None + + field_count = taos_field_count(self._res) + _fields = taos_fetch_fields(self._res) + fields = [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in _fields[:field_count]] + precision = taos_result_precision(self._res) + + _table = tmq_get_table_name(self._res) + table = "" if _table is NULL else _table.decode("utf-8") + + block = [None] * field_count + dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + cdef int i + for i in range(field_count): + data = pblock[i] + field = _fields[i] + + if field.type in UNSIZED_TYPE: + offsets = taos_get_column_data_offset(self._res, i) + block[i] = _parse_string(data, num_of_rows, offsets) + elif field.type in SIZED_TYPE: + is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + block[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) + block[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + else: + pass + + return MessageBlock(block, fields, num_of_rows, field_count, table) + + def value(self): + res_type = tmq_get_res_type(self._res) + if res_type in (tmq_res_t.TMQ_RES_TABLE_META, tmq_res_t.TMQ_RES_INVALID): + return None + + message_blocks = [] + while True: + mb = self._fetch_message_block() + if not mb: + break + + message_blocks.append(mb) + + return message_blocks + + def __dealloc__(self): + if self._res is not NULL: + taos_free_result(self._res) + + self._res = NULL + self._err_no = 0 + self._err_str = NULL + cdef class TaosConsumer: cdef dict _configs cdef tmq_conf_t *_tmq_conf @@ -649,7 +765,7 @@ cdef class TaosConsumer: } def __cinit__(self, configs: dict[str, str]): - self._init_config() + self._init_config(configs) self._init_consumer() self._subscribed = False @@ -659,7 +775,7 @@ cdef class TaosConsumer: self._configs = configs self._tmq_conf = tmq_conf_new() - if self._tmq_conf: + if self._tmq_conf is NULL: raise TmqError("new tmq conf failed") for k, v in self._configs.items(): @@ -724,42 +840,66 @@ cdef class TaosConsumer: if res is NULL: return None - return TaosResult(res) + return Message(res) - def commit(self, taos_res: TaosResult): - self.result_commit(taos_res) + def commit(self, message: Message=None, offsets: List[TopicPartition]=None): + if message: + self.message_commit(message) + return - async def commit_a(self, taos_res: TaosResult): - await self.result_commit_a(taos_res) + if offsets: + self.offsets_commit(offsets) + return - def result_commit(self, taos_res: TaosResult): - tmq_errno = tmq_commit_sync(self._tmq, taos_res._res) - if tmq_errno != 0: - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + tmq_commit_sync(self._tmq, NULL) + + async def commit_a(self, message: Message=None, offsets: List[TopicPartition]=None): + if message: + await self.message_commit_a(message) + return + + if offsets: + self.offsets_commit_a(offsets) - async def result_commit_a(self, taos_res: TaosResult): loop = asyncio.get_event_loop() fut = loop.create_future() - tmq_commit_async(self._tmq, taos_res._res, async_commit_future_wrapper, fut) + tmq_commit_async(self._tmq, NULL, async_commit_future_wrapper, fut) tmq_errno = await fut if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - def offset_commit(self, topic: str, vg_id: int, offset: int): - _topic = topic.encode("utf-8") - tmq_errno = tmq_commit_offset_sync(self._tmq, _topic, vg_id, offset) + def message_commit(self, message: Message): + tmq_errno = tmq_commit_sync(self._tmq, message._res) if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - - async def offset_commit_a(self, topic: str, vg_id: int, offset: int): + + async def message_commit_a(self, message: Message): loop = asyncio.get_event_loop() fut = loop.create_future() - _topic = topic.encode("utf-8") - tmq_commit_offset_async(self._tmq, _topic, vg_id, offset, async_commit_future_wrapper, fut) + tmq_commit_async(self._tmq, message._res, async_commit_future_wrapper, fut) tmq_errno = await fut if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + def offsets_commit(self, topic_partitions: List[TopicPartition]): + for tp in topic_partitions: + tmq_errno = tmq_commit_offset_sync(self._tmq, tp._topic, tp._partition, tp._offset) + if tmq_errno != 0: + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + + async def offsets_commit_a(self, topic_partitions: List[TopicPartition]): + loop = asyncio.get_event_loop() + futs = [] + for tp in topic_partitions: + fut = loop.create_future() + tmq_commit_offset_async(self._tmq, tp._topic, tp._partition, tp._offset, async_commit_future_wrapper, fut) + futs.append(fut) + + tmq_errnos = await asyncio.gather(futs, return_exceptions=True) + for tmq_errno in tmq_errnos: + if tmq_errno != 0: + raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + def assignment(self): cdef int32_t i cdef int32_t num_of_assignment @@ -850,17 +990,11 @@ cdef class TaosConsumer: return tp_list - def get_topic_name(self, taos_res: TaosResult): - return tmq_get_topic_name(taos_res._res) - - def get_db_name(self, taos_res: TaosResult): - return tmq_get_db_name(taos_res._res) - - def get_vgroup_id(self, taos_res: TaosResult): - return tmq_get_vgroup_id(taos_res._res) - - def get_vgroup_offset(self, taos_res: TaosResult): - return tmq_get_vgroup_offset(taos_res._res) + def __iter__(self): + while self._tmq: + message = self.poll() + if message: + yield message def __dealloc__(self): self.close() From 6889fdc6300666f14fc535eaf21182e3301dd932 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Tue, 5 Sep 2023 09:14:46 +0800 Subject: [PATCH 16/31] perf: using cython 1.add schemaless_insert 2.add TaosStmt --- taos/_cinterface.pxd | 26 ++ taos/_objects.pyx | 791 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 730 insertions(+), 87 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index ec3123d0..425bdbdc 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -18,6 +18,19 @@ cdef extern from "taos.h": TSDB_OPTION_SHELL_ACTIVITY_TIMER TSDB_OPTION_USE_ADAPTER TSDB_MAX_OPTIONS + ctypedef enum TSDB_SML_PROTOCOL_TYPE: + TSDB_SML_UNKNOWN_PROTOCOL + TSDB_SML_LINE_PROTOCOL + TSDB_SML_TELNET_PROTOCOL + TSDB_SML_JSON_PROTOCOL + ctypedef enum TSDB_SML_TIMESTAMP_TYPE: + TSDB_SML_TIMESTAMP_NOT_CONFIGURED + TSDB_SML_TIMESTAMP_HOURS + TSDB_SML_TIMESTAMP_MINUTES + TSDB_SML_TIMESTAMP_SECONDS + TSDB_SML_TIMESTAMP_MILLI_SECONDS + TSDB_SML_TIMESTAMP_MICRO_SECONDS + TSDB_SML_TIMESTAMP_NANO_SECONDS ctypedef struct TAOS_MULTI_BIND: int buffer_type void *buffer @@ -75,18 +88,31 @@ cdef extern from "taos.h": void taos_query_a_with_reqid(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param, int64_t reqid) void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) const void *taos_get_raw_block(TAOS_RES *res) + TAOS_STMT *taos_stmt_init(TAOS *taos) int taos_stmt_prepare(TAOS_STMT *stmt, const char *sql, unsigned long length) int taos_stmt_set_tbname(TAOS_STMT *stmt, const char *name) int taos_stmt_set_tbname_tags(TAOS_STMT *stmt, const char *name, TAOS_MULTI_BIND *tags) int taos_stmt_affected_rows(TAOS_STMT *stmt) TAOS_RES *taos_stmt_use_result(TAOS_STMT *stmt) + int taos_stmt_close(TAOS_STMT *stmt) int taos_stmt_execute(TAOS_STMT *stmt) int taos_stmt_add_batch(TAOS_STMT *stmt) int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) int taos_stmt_bind_param_batch(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) int taos_get_table_vgId(TAOS *taos, const char *db, const char *table, int *vgId) int taos_load_table_info(TAOS *taos, const char *tableNameList) + char *taos_stmt_errstr(TAOS_STMT *stmt) + + TAOS_RES *taos_schemaless_insert(TAOS *taos, char *lines[], int numLines, int protocol, int precision) + TAOS_RES *taos_schemaless_insert_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int64_t reqid) + TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision) + TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int64_t reqid) + TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl) + TAOS_RES *taos_schemaless_insert_ttl_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl, int64_t reqid) + TAOS_RES *taos_schemaless_insert_raw_ttl(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl) + TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl, int64_t reqid) + ctypedef struct tmq_t: pass diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 6793c89f..440e0291 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -1,5 +1,6 @@ # cython: profile=True +from libc.stdlib cimport malloc, free import asyncio from typing import Optional, List from taos._cinterface cimport * @@ -8,7 +9,8 @@ from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC import datetime as dt import pytz from collections import namedtuple -from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError +from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError, SchemalessError +from taos.constants import FieldType _priv_tz = None _utc_tz = pytz.timezone("UTC") @@ -152,6 +154,12 @@ cdef class TaosConnection: else: res = taos_query_with_reqid(self._raw_conn, _sql, req_id) + errno = taos_errno(res) + if errno != 0: + errstr = taos_errstr(res) + taos_free_result(res) + raise ProgrammingError(errstr, errno) + return TaosResult(res) async def query_async(self, sql: str, req_id: Optional[int] = None): @@ -166,15 +174,23 @@ cdef class TaosConnection: res = await fut return res - def subscribe(self, configs: dict[str, str], callback): + def statement(self, sql: Optional[str]=None): if self._raw_conn is NULL: return None - tmq_conf = tmq_conf_new() - for k, v in configs.items(): - _k = k.encode("utf-8") - _v = v.encode("utf-8") - tmq_conf_res = tmq_conf_set(tmq_conf, _k, _v) + stmt = taos_stmt_init(self._raw_conn) + if stmt is NULL: + raise StatementError("init taos statement failed!") + + if sql: + _sql = sql.encode("utf-8") + code = taos_stmt_prepare(stmt, _sql, len(_sql)) + if code != 0: + stmt_errstr = taos_stmt_errstr(stmt).decode("utf-8") + raise StatementError(stmt_errstr, code) + + return TaosStmt(stmt) + def load_table_info(self, tables: list): _tables = ",".join(tables).encode("utf-8") @@ -185,6 +201,244 @@ cdef class TaosConnection: taos_close(self._raw_conn) self._raw_conn = NULL + def schemaless_insert( + self, + lines: List[str], + protocol: TSDB_SML_PROTOCOL_TYPE, + precision: TSDB_SML_TIMESTAMP_TYPE, + req_id: Optional[int] = None, + ttl: Optional[int] = None, + ) -> int: + """ + 1.Line protocol and schemaless support + + ## Example + + ```python + import taos + conn = taos.connect() + conn.exec("drop database if exists test") + conn.select_db("test") + lines = [ + 'ste,t2=5,t3=L"ste" c1=true,c2=4,c3="string" 1626056811855516532', + ] + conn.schemaless_insert(lines, 0, "ns") + ``` + + 2.OpenTSDB telnet style API format support + + ## Example + + ```python + import taos + conn = taos.connect() + conn.exec("drop database if exists test") + conn.select_db("test") + lines = [ + 'cpu_load 1626056811855516532ns 2.0f32 id="tb1",host="host0",interface="eth0"', + ] + conn.schemaless_insert(lines, 1, None) + ``` + + 3.OpenTSDB HTTP JSON format support + + ## Example + + ```python + import taos + conn = taos.connect() + conn.exec("drop database if exists test") + conn.select_db("test") + payload = [''' + { + "metric": "cpu_load_0", + "timestamp": 1626006833610123, + "value": 55.5, + "tags": + { + "host": "ubuntu", + "interface": "eth0", + "Id": "tb0" + } + } + '''] + conn.schemaless_insert(lines, 2, None) + ``` + """ + num_of_lines = len(lines) + _lines = malloc(num_of_lines * sizeof(char*)) + if _lines is NULL: + raise MemoryError() + + for i in range(num_of_lines): + _line = lines[i].encode("utf-8") + _lines[i] = _line + + if ttl is None: + if req_id is None: + res = taos_schemaless_insert( + self._raw_conn, + _lines, + num_of_lines, + protocol, + precision, + ) + else: + res = taos_schemaless_insert_with_reqid( + self._raw_conn, + _lines, + num_of_lines, + protocol, + precision, + req_id, + ) + else: + if req_id is None: + res = taos_schemaless_insert_ttl( + self._raw_conn, + _lines, + num_of_lines, + protocol, + precision, + ttl, + ) + else: + res = taos_schemaless_insert_ttl_with_reqid( + self._raw_conn, + _lines, + num_of_lines, + protocol, + precision, + ttl, + req_id, + ) + + free(_lines) + errno = taos_errno(res) + affected_rows = taos_affected_rows(res) + if errno != 0: + errstr = taos_errstr(res) + taos_free_result(res) + raise SchemalessError(errstr, errno, affected_rows) + + return TaosResult(res) + + def schemaless_insert_raw( + self, + lines: str, + protocol: TSDB_SML_PROTOCOL_TYPE, + precision: TSDB_SML_TIMESTAMP_TYPE, + req_id: Optional[int] = None, + ttl: Optional[int] = None, + ) -> int: + """ + 1.Line protocol and schemaless support + + ## Example + + ```python + import taos + conn = taos.connect() + conn.exec("drop database if exists test") + conn.select_db("test") + lines = 'ste,t2=5,t3=L"ste" c1=true,c2=4,c3="string" 1626056811855516532' + conn.schemaless_insert_raw(lines, 0, "ns") + ``` + + 2.OpenTSDB telnet style API format support + + ## Example + + ```python + import taos + conn = taos.connect() + conn.exec("drop database if exists test") + conn.select_db("test") + lines = 'cpu_load 1626056811855516532ns 2.0f32 id="tb1",host="host0",interface="eth0"' + conn.schemaless_insert_raw(lines, 1, None) + ``` + + 3.OpenTSDB HTTP JSON format support + + ## Example + + ```python + import taos + conn = taos.connect() + conn.exec("drop database if exists test") + conn.select_db("test") + payload = ''' + { + "metric": "cpu_load_0", + "timestamp": 1626006833610123, + "value": 55.5, + "tags": + { + "host": "ubuntu", + "interface": "eth0", + "Id": "tb0" + } + } + ''' + conn.schemaless_insert_raw(lines, 2, None) + ``` + """ + cdef int32_t total_rows + _lines = lines.encode("utf-8") + _length = len(_lines) + + if ttl is None: + if req_id is None: + res = taos_schemaless_insert_raw( + self._raw_conn, + _lines, + _length, + &total_rows, + protocol, + precision, + ) + else: + res = taos_schemaless_insert_raw_with_reqid( + self._raw_conn, + _lines, + _length, + &total_rows, + protocol, + precision, + req_id, + ) + else: + if req_id is None: + res = taos_schemaless_insert_raw_ttl( + self._raw_conn, + _lines, + _length, + &total_rows, + protocol, + precision, + ttl, + ) + else: + res = taos_schemaless_insert_raw_ttl_with_reqid( + self._raw_conn, + _lines, + _length, + &total_rows, + protocol, + precision, + ttl, + req_id, + ) + + errno = taos_errno(res) + affected_rows = taos_affected_rows(res) + if errno != 0: + errstr = taos_errstr(res) + taos_free_result(res) + raise SchemalessError(errstr, errno, affected_rows) + + return TaosResult(res) + def commit(self): """Commit any pending transaction to the database. @@ -999,83 +1253,446 @@ cdef class TaosConsumer: def __dealloc__(self): self.close() -# ---------------------------------------- TMQ --------------------------------------------------------------- ^ - -# class TaosStmt(object): -# cdef TAOS_STMT *_stmt -# -# def __cinit__(self, size_t stmt): -# self._stmt = stmt -# -# def set_tbname(self, name: str): -# if self._stmt is NULL: -# raise StatementError("Invalid use of set_tbname") -# -# _name = name.decode("utf-8") -# taos_stmt_set_tbname(self._stmt, _name) -# -# def prepare(self, sql: str): -# _sql = sql.decode("utf-8") -# taos_stmt_prepare(self._stmt, _sql, len(_sql)) -# -# def set_tbname_tags(self, name: str, tags: list): -# # type: (str, Array[TaosBind]) -> None -# """Set table name with tags, tags is array of BindParams""" -# if self._stmt is NULL: -# raise StatementError("Invalid use of set_tbname_tags") -# taos_stmt_set_tbname_tags(self._stmt, name, NULL) -# -# def bind_param(self, params, add_batch=True): -# # type: (Array[TaosBind], bool) -> None -# if self._stmt is None: -# raise StatementError("Invalid use of stmt") -# taos_stmt_bind_param(self._stmt, params) -# if add_batch: -# taos_stmt_add_batch(self._stmt) -# -# def bind_param_batch(self, binds, add_batch=True): -# # type: (Array[TaosMultiBind], bool) -> None -# if self._stmt is NULL: -# raise StatementError("Invalid use of stmt") -# taos_stmt_bind_param_batch(self._stmt, binds) -# if add_batch: -# taos_stmt_add_batch(self._stmt) -# -# def add_batch(self): -# if self._stmt is NULL: -# raise StatementError("Invalid use of stmt") -# taos_stmt_add_batch(self._stmt) -# -# def execute(self): -# if self._stmt is NULL: -# raise StatementError("Invalid use of execute") -# taos_stmt_execute(self._stmt) -# -# def use_result(self): -# """NOTE: Don't use a stmt result more than once.""" -# result = taos_stmt_use_result(self._stmt) -# return TaosResult(result) -# -# @property -# def affected_rows(self): -# # type: () -> int -# return taos_stmt_affected_rows(self._stmt) -# -# def close(self): -# """Close stmt.""" -# if self._stmt is NULL: -# return -# taos_stmt_close(self._stmt) -# self._stmt = NULL -# -# def __dealloc__(self): -# self.close() -# -# -# class TaosMultiBind: -# cdef int buffer_type -# cdef void *buffer -# cdef uintptr_t buffer_length -# cdef int32_t *length -# cdef char *is_null -# cdef int num +# ---------------------------------------- statement --------------------------------------------------------------- ^ + +cdef class TaosStmt: + cdef TAOS_STMT *_stmt + + def __cinit__(self, size_t stmt): + self._stmt = stmt + + def _check_stmt_error(self, errno: int): + if errno != 0: + raise StatementError(taos_stmt_errstr(self._stmt), errno) + + def set_tbname(self, name: str): + if self._stmt is NULL: + raise StatementError("Invalid use of set_tbname") + + _name = name.decode("utf-8") + errno = taos_stmt_set_tbname(self._stmt, _name) + self._check_stmt_error(errno) + + def prepare(self, sql: str): + if self._stmt is NULL: + raise StatementError("Invalid use of set_tbname") + + _sql = sql.decode("utf-8") + errno = taos_stmt_prepare(self._stmt, _sql, len(_sql)) + self._check_stmt_error(errno) + + def set_tbname_tags(self, name: str, tags: list): + """Set table name with tags, tags is array of BindParams""" + if self._stmt is NULL: + raise StatementError("Invalid use of set_tbname_tags") + + errno = taos_stmt_set_tbname_tags(self._stmt, name, NULL) + self._check_stmt_error(errno) + + def bind_param(self, TaosMultiBind[:] params, add_batch=True): + if self._stmt is NULL: + raise StatementError("Invalid use of stmt") + + length = len(params) + multi_binds = malloc(length * sizeof(TAOS_MULTI_BIND)) + for i in range(length): + multi_binds[i] = params[i]._inner + errno = taos_stmt_bind_param(self._stmt, multi_binds) + free(multi_binds) + self._check_stmt_error(errno) + + if add_batch: + self.add_batch() + + def bind_param_batch(self, TaosMultiBind[:] params, add_batch=True): + if self._stmt is NULL: + raise StatementError("Invalid use of stmt") + + length = len(params) + multi_binds = malloc(length * sizeof(TAOS_MULTI_BIND)) + for i in range(length): + multi_binds[i] = params[i]._inner + errno = taos_stmt_bind_param_batch(self._stmt, multi_binds) + free(multi_binds) + self._check_stmt_error(errno) + + if add_batch: + self.add_batch() + + def add_batch(self): + if self._stmt is NULL: + raise StatementError("Invalid use of stmt") + + errno = taos_stmt_add_batch(self._stmt) + self._check_stmt_error(errno) + + def execute(self): + if self._stmt is NULL: + raise StatementError("Invalid use of execute") + + errno = taos_stmt_execute(self._stmt) + self._check_stmt_error(errno) + + def use_result(self): + if self._stmt is NULL: + raise StatementError("Invalid use of use_result") + + res = taos_stmt_use_result(self._stmt) + if res is NULL: + raise StatementError(taos_stmt_errstr(self._stmt)) + + return TaosResult(res) + + @property + def affected_rows(self): + # type: () -> int + return taos_stmt_affected_rows(self._stmt) + + def close(self): + """Close stmt.""" + if self._stmt is NULL: + return + + errno = taos_stmt_close(self._stmt) + self._check_stmt_error(errno) + self._stmt = NULL + + def __dealloc__(self): + self.close() + +cdef class TaosMultiBind: + cdef TAOS_MULTI_BIND _inner + + def bool(self, values): + self._inner.buffer_type = FieldType.C_BOOL + self._inner.buffer_length = sizeof(bool) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_BOOL_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def tinyint(self, values): + self._inner.buffer_type = FieldType.C_TINYINT + self._inner.buffer_length = sizeof(int8_t) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_TINYINT_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def smallint(self, values): + self._inner.buffer_type = FieldType.C_SMALLINT + self._inner.buffer_length = sizeof(int16_t) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_SMALLINT_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def int(self, values): + self._inner.buffer_type = FieldType.C_INT + self._inner.buffer_length = sizeof(int32_t) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_INT_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def bigint(self, values): + self._inner.buffer_type = FieldType.C_BIGINT + self._inner.buffer_length = sizeof(int64_t) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_BIGINT_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def float(self, values): + self._inner.buffer_type = FieldType.C_FLOAT + self._inner.buffer_length = sizeof(float) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_FLOAT_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def double(self, values): + self._inner.buffer_type = FieldType.C_DOUBLE + self._inner.buffer_length = sizeof(double) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_DOUBLE_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def tinyint_unsigned(self, values): + self._inner.buffer_type = FieldType.C_TINYINT_UNSIGNED + self._inner.buffer_length = sizeof(uint8_t) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_TINYINT_UNSIGNED_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def smallint_unsigned(self, values): + self._inner.buffer_type = FieldType.C_SMALLINT_UNSIGNED + self._inner.buffer_length = sizeof(uint16_t) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_SMALLINT_UNSIGNED_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def int_unsigned(self, values): + self._inner.buffer_type = FieldType.C_INT_UNSIGNED + self._inner.buffer_length = sizeof(uint32_t) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_INT_UNSIGNED_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def bigint_unsigned(self, values): + self._inner.buffer_type = FieldType.C_BIGINT_UNSIGNED + self._inner.buffer_length = sizeof(uint64_t) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_BIGINT_UNSIGNED_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + def timestamp(self, values, precision): + self._inner.buffer_type = FieldType.C_TIMESTAMP + self._inner.buffer_length = sizeof(int64_t) + self._inner.num = len(values) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + + if len(values) > 0: + if isinstance(values[0], dt.datetime): + values = [int(round((v - dt_epoch).total_seconds() * 10**(3*(precision+1)))) for v in values] + elif isinstance(values[0], str): + for i, v in enumerate(values): + v = dt.datetime.fromisoformat(v) + values[i] = int(round((v - dt_epoch).total_seconds() * 10**(3*(precision+1)))) + elif isinstance(values[0], float): + values = [int(round(v * 10**(3*(precision+1)))) for v in values] + else: + pass + + for i in range(self._inner.num): + v = values[i] + if v is None: + _buffer[i] = FieldType.C_BIGINT_NULL + _is_null[i] = 1 + else: + _buffer[i] = v + _is_null[i] = 0 + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + + + def binary(self, values): + _bytes = [v.encode("utf-8") for v in values if v is not None] + self._inner.buffer_type = FieldType.C_BINARY + self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) + self._inner.num = len(values) + _length = malloc(self._inner.num * sizeof(int32_t)) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + + for i in range(self._inner.num): + offset = i * self._inner.buffer_length + v = _bytes[i] + if v is None: + _buffer[offset] = b"\x00" + _is_null[i] = 1 + _length[i] = 0 + else: + _buffer[i] = v + _is_null[i] = 0 + _length[i] = len(v) + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + self._inner.length = _length + + def nchar(self, values): + _bytes = [v.encode("utf-8") for v in values if v is not None] + self._inner.buffer_type = FieldType.C_NCHAR + self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) + self._inner.num = len(values) + _length = malloc(self._inner.num * sizeof(int32_t)) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + + for i in range(self._inner.num): + offset = i * self._inner.buffer_length + v = _bytes[i] + if v is None: + _buffer[offset] = b"\x00" + _is_null[i] = 1 + _length[i] = 0 + else: + _buffer[i] = v + _is_null[i] = 0 + _length[i] = len(v) + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + self._inner.length = _length + + def json(self, values): + _bytes = [v.encode("utf-8") for v in values if v is not None] + self._inner.buffer_type = FieldType.C_JSON + self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) + self._inner.num = len(values) + _length = malloc(self._inner.num * sizeof(int32_t)) + _buffer = malloc(self._inner.num * self._inner.buffer_length) + _is_null = malloc(self._inner.num * sizeof(char)) + + + for i in range(self._inner.num): + offset = i * self._inner.buffer_length + v = _bytes[i] + if v is None: + _buffer[offset] = b"\x00" + _is_null[i] = 1 + _length[i] = 0 + else: + _buffer[i] = v + _is_null[i] = 0 + _length[i] = len(v) + + self._inner.buffer = _buffer + self._inner.is_null = _is_null + self._inner.length = _length + + def __dealloc__(self): + if self._inner.buffer is not NULL: + free(self._inner.buffer) + self._inner.buffer = NULL + + if self._inner.is_null is not NULL: + free(self._inner.is_null) + self._inner.is_null = NULL + + if self._inner.length is not NULL: + free(self._inner.length) + self._inner.length = NULL From 8c371fbc29f3075eb13f9b097e8505f5f993f635 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Tue, 5 Sep 2023 15:53:53 +0800 Subject: [PATCH 17/31] perf: using cython 1.add annotation --- taos/_cinterface.pxd | 8 +- taos/_objects.pyx | 173 ++++++++++++++++++++++++------------------- 2 files changed, 96 insertions(+), 85 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 425bdbdc..13f9ea19 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -111,20 +111,14 @@ cdef extern from "taos.h": TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl) TAOS_RES *taos_schemaless_insert_ttl_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl, int64_t reqid) TAOS_RES *taos_schemaless_insert_raw_ttl(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl) - TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl, int64_t reqid) - - + TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl, int64_t reqid) ctypedef struct tmq_t: pass - ctypedef struct tmq_conf_t: pass - ctypedef struct tmq_list_t: pass - ctypedef void tmq_commit_cb(tmq_t *tmq, int32_t code, void *param) except * - ctypedef enum tmq_conf_res_t: TMQ_CONF_UNKNOWN TMQ_CONF_INVALID diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 440e0291..e0d243ca 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -2,7 +2,7 @@ from libc.stdlib cimport malloc, free import asyncio -from typing import Optional, List +from typing import Optional, List, Tuple, Dict, Iterator from taos._cinterface cimport * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC @@ -58,9 +58,10 @@ cdef void async_block_future_wrapper(void *param, TAOS_RES *res, int num_of_rows cdef int i = 0 with gil: taos_result, fut = param - block, n = [], 0 if num_of_rows > 0: block, n = taos_result.fetch_block() + else: + block, n = [], 0 fut.get_loop().call_soon_threadsafe(fut.set_result, (block, n)) @@ -128,26 +129,26 @@ cdef class TaosConnection: self.close() @property - def client_info(self): + def client_info(self) -> str: return taos_get_client_info().decode("utf-8") @property - def server_info(self): + def server_info(self) -> Optional[str]: # type: () -> str if self._raw_conn is NULL: return return taos_get_server_info(self._raw_conn).decode("utf-8") - def select_db(self, database: str): + def select_db(self, str database): _database = database.encode("utf-8") res = taos_select_db(self._raw_conn, _database) if res != 0: raise DatabaseError("select database error", res) - def execute(self, sql: str, req_id: Optional[int] = None): + def execute(self, str sql, req_id: Optional[int] = None) -> int: return self.query(sql, req_id).affected_rows - def query(self, sql: str, req_id: Optional[int] = None): + def query(self, str sql, req_id: Optional[int] = None) -> TaosResult: _sql = sql.encode("utf-8") if req_id is None: res = taos_query(self._raw_conn, _sql) @@ -162,7 +163,7 @@ cdef class TaosConnection: return TaosResult(res) - async def query_async(self, sql: str, req_id: Optional[int] = None): + async def query_async(self, str sql, req_id: Optional[int] = None) -> TaosResult: loop = asyncio.get_event_loop() _sql = sql.encode("utf-8") fut = loop.create_future() @@ -174,7 +175,7 @@ cdef class TaosConnection: res = await fut return res - def statement(self, sql: Optional[str]=None): + def statement(self, sql: Optional[str]=None) -> TaosStmt: if self._raw_conn is NULL: return None @@ -192,9 +193,11 @@ cdef class TaosConnection: return TaosStmt(stmt) - def load_table_info(self, tables: list): + def load_table_info(self, tables: List[str]): _tables = ",".join(tables).encode("utf-8") - taos_load_table_info(self._raw_conn, _tables) + errno = taos_load_table_info(self._raw_conn, _tables) + if errno != 0: + raise OperationalError(taos_errstr(NULL), errno) def close(self): if self._raw_conn is not NULL: @@ -457,8 +460,7 @@ cdef class TaosConnection: """Clear unused result set on this connection.""" pass - def get_table_vgroup_id(self, db: str, table: str): - # type: (str, str) -> int + def get_table_vgroup_id(self, str db, str table) -> int: """ get table's vgroup id. It's require db name and table name, and return an int type vgroup id. """ @@ -520,6 +522,7 @@ cdef class TaosResult: self._check_result_error() self._field_count = taos_field_count(self._res) self._fields = taos_fetch_fields(self._res) + self._taos_fields = [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] self._precision = taos_result_precision(self._res) self._affected_rows = taos_affected_rows(self._res) self._row_count = 0 @@ -535,7 +538,7 @@ cdef class TaosResult: @property def fields(self): - return [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] + return self._taos_fields @property def field_count(self): @@ -554,12 +557,12 @@ cdef class TaosResult: return self._row_count def _check_result_error(self): - errno = taos_errno(self._res) + errno = taos_errno(self._res) if errno != 0: errstr = taos_errstr(self._res) raise ProgrammingError(errstr, errno) - def _fetch_block(self): + def _fetch_block(self) -> Tuple[List, int]: cdef TAOS_ROW pblock num_of_rows = taos_fetch_block(self._res, &pblock) if num_of_rows == 0: @@ -586,7 +589,7 @@ cdef class TaosResult: return blocks, abs(num_of_rows) - def fetch_block(self): + def fetch_block(self) -> Tuple[List, int]: if self._res is NULL: raise OperationalError("Invalid use of fetch iterator") @@ -595,7 +598,7 @@ cdef class TaosResult: return [r for r in map(tuple, zip(*block))], num_of_rows - def fetch_all(self): + def fetch_all(self) -> List[Tuple]: if self._res is NULL: raise OperationalError("Invalid use of fetchall") @@ -612,7 +615,7 @@ cdef class TaosResult: return [r for b in blocks for r in map(tuple, zip(*b))] - def fetch_all_into_dict(self): + def fetch_all_into_dict(self) -> List[Dict]: if self._res is NULL: raise OperationalError("Invalid use of fetchall") @@ -631,7 +634,7 @@ cdef class TaosResult: return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] - def rows_iter(self): + def rows_iter(self) -> Iterator[Tuple]: if self._res is NULL: raise OperationalError("Invalid use of rows_iter") @@ -662,7 +665,7 @@ cdef class TaosResult: self._row_count += 1 yield row - def blocks_iter(self): + def blocks_iter(self) -> Iterator[Tuple[List, int]]: if self._res is NULL: raise OperationalError("Invalid use of rows_iter") @@ -674,7 +677,7 @@ cdef class TaosResult: yield [r for r in map(tuple, zip(*block))], num_of_rows - async def rows_iter_a(self): + async def rows_iter_a(self) -> Iterator[Tuple]: if self._res is NULL: raise OperationalError("Invalid use of rows_iter_a") @@ -691,7 +694,7 @@ cdef class TaosResult: for row in rows: yield row - async def blocks_iter_a(self): + async def blocks_iter_a(self) -> Iterator[Tuple[List, int]]: if self._res is NULL: raise OperationalError("Invalid use of blocks_iter_a") @@ -721,12 +724,12 @@ cdef class TaosCursor: cdef TaosConnection _connection cdef TaosResult _result - def __init__(self, connection: TaosConnection=None) -> None: + def __init__(self, connection: TaosConnection=None): self._description = [] self._connection = connection self._result = None - def __iter__(self): + def __iter__(self) -> Iterator[Tuple]: for block, _ in self._result.blocks_iter(): for row in block: yield row @@ -781,7 +784,7 @@ cdef class TaosCursor: else: return self._result - def execute_many(self, operation, data_list, req_id: Optional[int] = None): + def executemany(self, operation, data_list, req_id: Optional[int] = None) -> int: """ Prepare a database operation (query or command) and then execute it against all parameter sequences or mappings found in the sequence seq_of_parameters. @@ -801,22 +804,26 @@ cdef class TaosCursor: affected_rows += self.execute(sql, req_id=req_id) return affected_rows - def fetchone(self): + def fetchone(self) -> Optional[List]: try: row = next(self) except StopIteration: row = None return row - def fetchmany(self, size=None): + def fetchmany(self, size=None) -> List[Tuple]: + cdef int i = 0 size = size or 1 rows = [] for row in self: rows.append(row) + i += 1 + if i >= size: + break return rows - def fetchall(self): + def fetchall(self) -> List[Tuple]: return [r for r in self] def nextset(self): @@ -894,22 +901,22 @@ cdef class MessageBlock: self._ncols = ncols self._table = table - def fields(self): + def fields(self) -> List[TaosField]: return self._fields - def nrows(self): + def nrows(self) -> int: return self._nrows - def ncols(self): + def ncols(self) -> int: return self._ncols - def table(self): + def table(self) -> str: return self._table - def fetchall(self): + def fetchall(self) -> List[Tuple]: return [r for r in self] - def __iter__(self): + def __iter__(self) -> Iterator[Tuple]: return zip(*self._block) @@ -923,22 +930,26 @@ cdef class Message: self._err_no = taos_errno(self._res) self._err_str = taos_errstr(self._res) - def error(self): + def error(self) -> Optional[TmqError]: return TmqError(self._err_str) if self._err_no else None - def topic(self): - return tmq_get_topic_name(self._res) + def topic(self) -> Optional[str]: + _topic = tmq_get_topic_name(self._res) + topic = None if _topic is NULL else _topic.decode("utf-8") + return topic - def database(self): - return tmq_get_db_name(self._res) + def database(self) -> Optional[str]: + _db = tmq_get_db_name(self._res) + db = None if _db is NULL else _db.decode("utf-8") + return db - def vgroup(self): + def vgroup(self) -> int: return tmq_get_vgroup_id(self._res) - def offset(self): + def offset(self) -> int: return tmq_get_vgroup_offset(self._res) - def _fetch_message_block(self): + def _fetch_message_block(self) -> MessageBlock: cdef TAOS_ROW pblock num_of_rows = taos_fetch_block(self._res, &pblock) if num_of_rows == 0: @@ -973,10 +984,10 @@ cdef class Message: return MessageBlock(block, fields, num_of_rows, field_count, table) - def value(self): + def value(self) -> List[MessageBlock]: res_type = tmq_get_res_type(self._res) if res_type in (tmq_res_t.TMQ_RES_TABLE_META, tmq_res_t.TMQ_RES_INVALID): - return None + return None # TODO: deal with meta data message_blocks = [] while True: @@ -995,7 +1006,8 @@ cdef class Message: self._res = NULL self._err_no = 0 self._err_str = NULL - + + cdef class TaosConsumer: cdef dict _configs cdef tmq_conf_t *_tmq_conf @@ -1018,12 +1030,12 @@ cdef class TaosConsumer: 'td.connect.db', } - def __cinit__(self, configs: dict[str, str]): + def __cinit__(self, dict configs): self._init_config(configs) self._init_consumer() self._subscribed = False - def _init_config(self, configs: dict[str, str]): + def _init_config(self, dict configs): if 'group.id' not in configs: raise TmqError('missing group.id in consumer config setting') @@ -1049,7 +1061,7 @@ cdef class TaosConsumer: if self._tmq is NULL: raise TmqError("new tmq consumer failed") - def subscribe(self, topics: list[str]): + def subscribe(self, topics: List[str]): tmq_list = tmq_list_new() if tmq_list is NULL: raise TmqError("new tmq list failed!") @@ -1085,7 +1097,7 @@ cdef class TaosConsumer: tmq_consumer_close(self._tmq) self._tmq = NULL - def poll(self, float timeout=1.0): + def poll(self, float timeout=1.0) -> Optional[Message]: if not self._subscribed: raise TmqError("unsubscribe topic") @@ -1154,7 +1166,7 @@ cdef class TaosConsumer: if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - def assignment(self): + def assignment(self) -> List[TopicPartition]: cdef int32_t i cdef int32_t num_of_assignment cdef tmq_topic_assignment *p_assignment = NULL @@ -1185,9 +1197,7 @@ cdef class TaosConsumer: if tmq_errno != 0: raise TmqError(tmq_err2str(tmq_errno), tmq_errno) - tmq_offset_seek(self._tmq, partition.topic, partition.partition, partition.offset) - - def committed(self, partitions: list[TopicPartition]) -> list[TopicPartition]: + def committed(self, partitions: List[TopicPartition]) -> List[TopicPartition]: """ Retrieve committed offsets for the specified partitions. @@ -1198,6 +1208,7 @@ cdef class TaosConsumer: for partition in partitions: if not isinstance(partition, TopicPartition): raise TmqError(msg='Invalid partition type') + offset = tmq_committed(self._tmq, partition._topic, partition._partition) if offset < 0: @@ -1207,7 +1218,7 @@ cdef class TaosConsumer: return partitions - def position(self, partitions: list[TopicPartition]) -> list[TopicPartition]: + def position(self, partitions: List[TopicPartition]) -> List[TopicPartition]: """ Retrieve current positions (offsets) for the specified partitions. @@ -1227,7 +1238,7 @@ cdef class TaosConsumer: return partitions - def list_topics(self): + def list_topics(self) -> List[str]: cdef int i cdef tmq_list_t *topics tmq_errno = tmq_subscription(self._tmq, &topics) @@ -1244,7 +1255,7 @@ cdef class TaosConsumer: return tp_list - def __iter__(self): + def __iter__(self) -> Iterator[Message]: while self._tmq: message = self.poll() if message: @@ -1261,59 +1272,65 @@ cdef class TaosStmt: def __cinit__(self, size_t stmt): self._stmt = stmt - def _check_stmt_error(self, errno: int): + def _check_stmt_error(self, int errno): if errno != 0: raise StatementError(taos_stmt_errstr(self._stmt), errno) - def set_tbname(self, name: str): + def set_tbname(self, str name): if self._stmt is NULL: raise StatementError("Invalid use of set_tbname") - _name = name.decode("utf-8") + _name = name.encode("utf-8") errno = taos_stmt_set_tbname(self._stmt, _name) self._check_stmt_error(errno) - def prepare(self, sql: str): + def prepare(self, str sql): if self._stmt is NULL: raise StatementError("Invalid use of set_tbname") - _sql = sql.decode("utf-8") + _sql = sql.encode("utf-8") errno = taos_stmt_prepare(self._stmt, _sql, len(_sql)) self._check_stmt_error(errno) - def set_tbname_tags(self, name: str, tags: list): + def set_tbname_tags(self, str name, TaosMultiBind[:] tags): """Set table name with tags, tags is array of BindParams""" if self._stmt is NULL: raise StatementError("Invalid use of set_tbname_tags") - - errno = taos_stmt_set_tbname_tags(self._stmt, name, NULL) + + _name = name.encode("utf-8") + length = len(tags) + _tags = malloc(length * sizeof(TAOS_MULTI_BIND)) + for i in range(length): + _tags[i] = tags[i]._inner + errno = taos_stmt_set_tbname_tags(self._stmt, _name, NULL) + free(_tags) self._check_stmt_error(errno) - def bind_param(self, TaosMultiBind[:] params, add_batch=True): + def bind_param(self, TaosMultiBind[:] binds, bool add_batch=True): if self._stmt is NULL: raise StatementError("Invalid use of stmt") - length = len(params) - multi_binds = malloc(length * sizeof(TAOS_MULTI_BIND)) + length = len(binds) + _binds = malloc(length * sizeof(TAOS_MULTI_BIND)) for i in range(length): - multi_binds[i] = params[i]._inner - errno = taos_stmt_bind_param(self._stmt, multi_binds) - free(multi_binds) + _binds[i] = binds[i]._inner + errno = taos_stmt_bind_param(self._stmt, _binds) + free(_binds) self._check_stmt_error(errno) if add_batch: self.add_batch() - def bind_param_batch(self, TaosMultiBind[:] params, add_batch=True): + def bind_param_batch(self, TaosMultiBind[:] binds, bool add_batch=True): if self._stmt is NULL: raise StatementError("Invalid use of stmt") - length = len(params) - multi_binds = malloc(length * sizeof(TAOS_MULTI_BIND)) + length = len(binds) + _binds = malloc(length * sizeof(TAOS_MULTI_BIND)) for i in range(length): - multi_binds[i] = params[i]._inner - errno = taos_stmt_bind_param_batch(self._stmt, multi_binds) - free(multi_binds) + _binds[i] = binds[i]._inner + errno = taos_stmt_bind_param_batch(self._stmt, _binds) + free(_binds) self._check_stmt_error(errno) if add_batch: @@ -1333,7 +1350,7 @@ cdef class TaosStmt: errno = taos_stmt_execute(self._stmt) self._check_stmt_error(errno) - def use_result(self): + def use_result(self) -> TaosResult: if self._stmt is NULL: raise StatementError("Invalid use of use_result") From b108305330907919a8aa90c0fcc6ca53a4fcf85c Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Wed, 6 Sep 2023 15:55:41 +0800 Subject: [PATCH 18/31] perf: using cython 1. fix TaosStmt, TaosMultiBind 2. add TaosMultiBinds 3. fix row_iter for null value 4. add annotation --- taos/_objects.pyx | 195 ++++++++++++++++++++++++++++----------------- taos/sqlalchemy.py | 1 + 2 files changed, 125 insertions(+), 71 deletions(-) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index e0d243ca..506ee8b0 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -1,6 +1,8 @@ # cython: profile=True from libc.stdlib cimport malloc, free +from libc.string cimport memset, strcpy, memcpy +import ctypes import asyncio from typing import Optional, List, Tuple, Dict, Iterator from taos._cinterface cimport * @@ -163,7 +165,7 @@ cdef class TaosConnection: return TaosResult(res) - async def query_async(self, str sql, req_id: Optional[int] = None) -> TaosResult: + async def query_a(self, str sql, req_id: Optional[int] = None) -> TaosResult: loop = asyncio.get_event_loop() _sql = sql.encode("utf-8") fut = loop.create_future() @@ -185,10 +187,9 @@ cdef class TaosConnection: if sql: _sql = sql.encode("utf-8") - code = taos_stmt_prepare(stmt, _sql, len(_sql)) - if code != 0: - stmt_errstr = taos_stmt_errstr(stmt).decode("utf-8") - raise StatementError(stmt_errstr, code) + errno = taos_stmt_prepare(stmt, _sql, len(_sql)) + if errno != 0: + raise StatementError(taos_stmt_errstr(stmt), errno) return TaosStmt(stmt) @@ -453,7 +454,7 @@ cdef class TaosConnection: """Void functionality""" pass - def cursor(self): + def cursor(self) -> TaosCursor: return TaosCursor(self) def clear_result_set(self): @@ -467,9 +468,9 @@ cdef class TaosConnection: cdef int vg_id _db = db.encode("utf-8") _table = table.encode("utf-8") - code = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) - if code != 0: - raise InternalError(taos_errstr(NULL)) + errno = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) + if errno != 0: + raise InternalError(taos_errstr(NULL), errno) return vg_id @@ -512,6 +513,7 @@ cdef class TaosField: cdef class TaosResult: cdef TAOS_RES *_res cdef TAOS_FIELD *_fields + cdef list _taos_fields cdef int _field_count cdef int _precision cdef int _row_count @@ -528,14 +530,17 @@ cdef class TaosResult: self._row_count = 0 def __str__(self): - return "TaosResult{res: %s}" % (self._res, ) + return "TaosResult(field_count=%d, precision=%d, affected_rows=%d, row_count=%d)" % (self._field_count, self._precision, self._affected_rows, self._row_count) def __repr__(self): - return "TaosResult{res: %s}" % (self._res, ) + return "TaosResult(field_count=%d, precision=%d, affected_rows=%d, row_count=%d)" % (self._field_count, self._precision, self._affected_rows, self._row_count) def __iter__(self): return self.rows_iter() + def __aiter__(self): + return self.rows_iter_a() + @property def fields(self): return self._taos_fields @@ -654,11 +659,11 @@ cdef class TaosResult: data = taos_row[i] field = self._fields[i] if field.type in UNSIZED_TYPE: - row[i] = _parse_string(data, 1, offsets)[0] + row[i] = _parse_string(data, 1, offsets)[0] if data is not NULL else None # FIXME: is it ok to set offsets = [-2] here elif field.type in SIZED_TYPE: - row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] + row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] if data is not NULL else None elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] + row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] if data is not NULL else None else: pass @@ -703,7 +708,7 @@ cdef class TaosResult: fut = loop.create_future() param = (self, fut) taos_fetch_rows_a(self._res, async_block_future_wrapper, param) - # taos_fetch_raw_block_a(self._res, async_block_future_wrapper, param) + # taos_fetch_raw_block_a(self._res, async_block_future_wrapper, param) # FIXME: have some problem when parsing nchar block, n = await fut if not block: @@ -724,7 +729,7 @@ cdef class TaosCursor: cdef TaosConnection _connection cdef TaosResult _result - def __init__(self, connection: TaosConnection=None): + def __init__(self, connection: Optional[TaosConnection]=None): self._description = [] self._connection = connection self._result = None @@ -886,6 +891,9 @@ cdef class TopicPartition: def end(self): return self._end + def __str__(self): + return "TopicPartition(topic=%s, partition=%s, offset=%s)" % (self.topic, self.partition, self.offset) + cdef class MessageBlock: cdef list _block @@ -1292,45 +1300,30 @@ cdef class TaosStmt: errno = taos_stmt_prepare(self._stmt, _sql, len(_sql)) self._check_stmt_error(errno) - def set_tbname_tags(self, str name, TaosMultiBind[:] tags): + def set_tbname_tags(self, str name, TaosMultiBinds tags): """Set table name with tags, tags is array of BindParams""" if self._stmt is NULL: raise StatementError("Invalid use of set_tbname_tags") _name = name.encode("utf-8") - length = len(tags) - _tags = malloc(length * sizeof(TAOS_MULTI_BIND)) - for i in range(length): - _tags[i] = tags[i]._inner - errno = taos_stmt_set_tbname_tags(self._stmt, _name, NULL) - free(_tags) + errno = taos_stmt_set_tbname_tags(self._stmt, _name, tags._binds) self._check_stmt_error(errno) - def bind_param(self, TaosMultiBind[:] binds, bool add_batch=True): + def bind_param(self, TaosMultiBinds binds, bool add_batch=True): if self._stmt is NULL: raise StatementError("Invalid use of stmt") - length = len(binds) - _binds = malloc(length * sizeof(TAOS_MULTI_BIND)) - for i in range(length): - _binds[i] = binds[i]._inner - errno = taos_stmt_bind_param(self._stmt, _binds) - free(_binds) + errno = taos_stmt_bind_param(self._stmt, binds._binds) self._check_stmt_error(errno) if add_batch: self.add_batch() - def bind_param_batch(self, TaosMultiBind[:] binds, bool add_batch=True): + def bind_param_batch(self, TaosMultiBinds binds, bool add_batch=True): if self._stmt is NULL: raise StatementError("Invalid use of stmt") - length = len(binds) - _binds = malloc(length * sizeof(TAOS_MULTI_BIND)) - for i in range(length): - _binds[i] = binds[i]._inner - errno = taos_stmt_bind_param_batch(self._stmt, _binds) - free(_binds) + errno = taos_stmt_bind_param_batch(self._stmt, binds._binds) self._check_stmt_error(errno) if add_batch: @@ -1377,8 +1370,73 @@ cdef class TaosStmt: def __dealloc__(self): self.close() +cdef class TaosMultiBinds: + cdef size_t _size + cdef TAOS_MULTI_BIND *_binds + + def __cinit__(self, size_t size): + self._size = size + self._binds = malloc(size * sizeof(TAOS_MULTI_BIND)) + if self._binds is NULL: + raise MemoryError() + + memset(self._binds, 0, size * sizeof(TAOS_MULTI_BIND)) + + def __str__(self): + return "TaosMultiBinds(size=%d)" % (self._size, ) + + def __repr__(self): + return "TaosMultiBinds(size=%d)" % (self._size, ) + + def describe(self): + if self._binds is NULL: + return + + for i in range(self._size): + buf_len = self._binds[i].num * self._binds[i].buffer_length + is_null_len = self._binds[i].num * sizeof(char) + buffer = ((self._binds[i].buffer))[:buf_len] + is_null = self._binds[i].is_null[:is_null_len] + print(i, buf_len, buffer, is_null_len, is_null) + + def __getitem__(self, item): + if item >= self._size: + raise IndexError() + + _pbind = self._binds + (item * sizeof(TAOS_MULTI_BIND)) + return TaosMultiBind(_pbind) + + def __dealloc__(self): + if self._binds is not NULL: + for i in range(self._size): + if self._binds[i].buffer is not NULL: + free(self._binds[i].buffer) + self._binds[i].buffer = NULL + + if self._binds[i].is_null is not NULL: + free(self._binds[i].is_null) + self._binds[i].is_null = NULL + + if self._binds[i].length is not NULL: + free(self._binds[i].length) + self._binds[i].length = NULL + + free(self._binds) + self._binds = NULL + + self._size = 0 + cdef class TaosMultiBind: - cdef TAOS_MULTI_BIND _inner + cdef TAOS_MULTI_BIND *_inner + + def __cinit__(self, size_t pbind): + self._inner = pbind + + def __str__(self): + return "TaosMultiBind(buffer_type=%s, buffer_length=%d, num=%d)" % (self._inner.buffer_type, self._inner.buffer_length, self._inner.num) + + def __repr__(self): + return "TaosMultiBind(buffer_type=%s, buffer_length=%d, num=%d)" % (self._inner.buffer_type, self._inner.buffer_length, self._inner.num) def bool(self, values): self._inner.buffer_type = FieldType.C_BOOL @@ -1485,7 +1543,8 @@ cdef class TaosMultiBind: for i in range(self._inner.num): v = values[i] if v is None: - _buffer[i] = FieldType.C_FLOAT_NULL + # _buffer[i] = FieldType.C_FLOAT_NULL + _buffer[i] = float('nan') _is_null[i] = 1 else: _buffer[i] = v @@ -1504,7 +1563,8 @@ cdef class TaosMultiBind: for i in range(self._inner.num): v = values[i] if v is None: - _buffer[i] = FieldType.C_DOUBLE_NULL + # _buffer[i] = FieldType.C_DOUBLE_NULL + _buffer[i] = float('nan') _is_null[i] = 1 else: _buffer[i] = v @@ -1624,92 +1684,85 @@ cdef class TaosMultiBind: def binary(self, values): - _bytes = [v.encode("utf-8") for v in values if v is not None] + _bytes = [v if v is None else v.encode("utf-8") for v in values] self._inner.buffer_type = FieldType.C_BINARY self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) self._inner.num = len(values) _length = malloc(self._inner.num * sizeof(int32_t)) - _buffer = malloc(self._inner.num * self._inner.buffer_length) + _buffer = malloc(self._inner.num * self._inner.buffer_length) _is_null = malloc(self._inner.num * sizeof(char)) - + buf_list = [] for i in range(self._inner.num): - offset = i * self._inner.buffer_length v = _bytes[i] if v is None: - _buffer[offset] = b"\x00" + buf_list.append(ctypes.create_string_buffer(self._inner.buffer_length).raw) _is_null[i] = 1 _length[i] = 0 else: - _buffer[i] = v + buf_list.append(ctypes.create_string_buffer(v, self._inner.buffer_length).raw) _is_null[i] = 0 _length[i] = len(v) + _buf = b"".join(buf_list) + memcpy(_buffer, _buf, self._inner.num * self._inner.buffer_length) + self._inner.buffer = _buffer self._inner.is_null = _is_null self._inner.length = _length def nchar(self, values): - _bytes = [v.encode("utf-8") for v in values if v is not None] + _bytes = [v if v is None else v.encode("utf-8") for v in values] self._inner.buffer_type = FieldType.C_NCHAR self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) self._inner.num = len(values) _length = malloc(self._inner.num * sizeof(int32_t)) - _buffer = malloc(self._inner.num * self._inner.buffer_length) + _buffer = malloc(self._inner.num * self._inner.buffer_length) _is_null = malloc(self._inner.num * sizeof(char)) - + buf_list = [] for i in range(self._inner.num): - offset = i * self._inner.buffer_length v = _bytes[i] if v is None: - _buffer[offset] = b"\x00" + buf_list.append(ctypes.create_string_buffer(self._inner.buffer_length).raw) _is_null[i] = 1 _length[i] = 0 else: - _buffer[i] = v + buf_list.append(ctypes.create_string_buffer(v, self._inner.buffer_length).raw) _is_null[i] = 0 _length[i] = len(v) + _buf = b"".join(buf_list) + memcpy(_buffer, _buf, self._inner.num * self._inner.buffer_length) + self._inner.buffer = _buffer self._inner.is_null = _is_null self._inner.length = _length def json(self, values): - _bytes = [v.encode("utf-8") for v in values if v is not None] + _bytes = [v if v is None else v.encode("utf-8") for v in values] self._inner.buffer_type = FieldType.C_JSON self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) self._inner.num = len(values) _length = malloc(self._inner.num * sizeof(int32_t)) - _buffer = malloc(self._inner.num * self._inner.buffer_length) + _buffer = malloc(self._inner.num * self._inner.buffer_length) _is_null = malloc(self._inner.num * sizeof(char)) - + buf_list = [] for i in range(self._inner.num): - offset = i * self._inner.buffer_length v = _bytes[i] if v is None: - _buffer[offset] = b"\x00" + buf_list.append(ctypes.create_string_buffer(self._inner.buffer_length).raw) _is_null[i] = 1 _length[i] = 0 else: - _buffer[i] = v + buf_list.append(ctypes.create_string_buffer(v, self._inner.buffer_length).raw) _is_null[i] = 0 _length[i] = len(v) + _buf = b"".join(buf_list) + memcpy(_buffer, _buf, self._inner.num * self._inner.buffer_length) + self._inner.buffer = _buffer self._inner.is_null = _is_null self._inner.length = _length - - def __dealloc__(self): - if self._inner.buffer is not NULL: - free(self._inner.buffer) - self._inner.buffer = NULL - - if self._inner.is_null is not NULL: - free(self._inner.is_null) - self._inner.is_null = NULL - - if self._inner.length is not NULL: - free(self._inner.length) - self._inner.length = NULL diff --git a/taos/sqlalchemy.py b/taos/sqlalchemy.py index ffb2d395..6baadbc7 100644 --- a/taos/sqlalchemy.py +++ b/taos/sqlalchemy.py @@ -76,6 +76,7 @@ def _resolve_type(self, type_): class AlchemyTaosConnection: paramstyle = "pyformat" + from taos.error import Warning, Error, InterfaceError, DatabaseError, DataError, OperationalError, IntegrityError, InternalError, ProgrammingError, NotSupportedError def connect(self, **kwargs): host = kwargs["host"] if "host" in kwargs else "localhost" From 6e739e868de9fb60dacf99867e5a30804151f228 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Wed, 6 Sep 2023 17:23:01 +0800 Subject: [PATCH 19/31] perf: using cython 1. add taos_stop_query --- taos/_cinterface.pxd | 1 + taos/_objects.pyx | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 13f9ea19..d01faecc 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -66,6 +66,7 @@ cdef extern from "taos.h": int taos_init() bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col) TAOS_FIELD *taos_fetch_fields(TAOS_RES *res) + void taos_stop_query(TAOS_RES *res) int taos_field_count(TAOS_RES *res) int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) int taos_result_precision(TAOS_RES *res) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 506ee8b0..a4cc0702 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -4,7 +4,7 @@ from libc.stdlib cimport malloc, free from libc.string cimport memset, strcpy, memcpy import ctypes import asyncio -from typing import Optional, List, Tuple, Dict, Iterator +from typing import Optional, List, Tuple, Dict, Iterator, AsyncIterator from taos._cinterface cimport * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC @@ -682,7 +682,7 @@ cdef class TaosResult: yield [r for r in map(tuple, zip(*block))], num_of_rows - async def rows_iter_a(self) -> Iterator[Tuple]: + async def rows_iter_a(self) -> AsyncIterator[Tuple]: if self._res is NULL: raise OperationalError("Invalid use of rows_iter_a") @@ -699,7 +699,7 @@ cdef class TaosResult: for row in rows: yield row - async def blocks_iter_a(self) -> Iterator[Tuple[List, int]]: + async def blocks_iter_a(self) -> AsyncIterator[Tuple[List, int]]: if self._res is NULL: raise OperationalError("Invalid use of blocks_iter_a") @@ -716,6 +716,9 @@ cdef class TaosResult: yield block, n + def stop_query(self): + return taos_stop_query(self._res) + def __dealloc__(self): if self._res is not NULL: taos_free_result(self._res) From 17fd1c3e0264cebae8244ecbc160458ed23decf3 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Wed, 6 Sep 2023 19:17:20 +0800 Subject: [PATCH 20/31] perf: using cython 1. better error info --- taos/_objects.pyx | 213 +++++++++++++++++++++++++--------------------- 1 file changed, 117 insertions(+), 96 deletions(-) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index a4cc0702..e42239c5 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -29,12 +29,16 @@ def set_tz(tz): _priv_tz = tz _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) +cdef _check_malloc(void *ptr): + if ptr is NULL: + raise MemoryError() cdef void async_result_future_wrapper(void *param, TAOS_RES *res, int code) nogil: with gil: fut = param if code != 0: - e = ProgrammingError(taos_errstr(res), code) + errstr = taos_errstr(res).decode("utf-8") + e = ProgrammingError(errstr, code) fut.get_loop().call_soon_threadsafe(fut.set_exception, e) else: taos_result = TaosResult(res) @@ -78,53 +82,49 @@ cdef class TaosConnection: cdef char *_config cdef TAOS *_raw_conn - def __cinit__(self, host=None, user="root", password="taosdata", database=None, port=None, timezone=None, config=None): - if host: - host = host.encode("utf-8") - self._host = host - - if user: - user = user.encode("utf-8") - self._user = user - - if password: - password = password.encode("utf-8") - self._password = password + def __cinit__(self, **kwargs): + self._init_options(**kwargs) + self._init_conn(**kwargs) + self._check_conn_error() - if database: - database =database.encode("utf-8") - self._database = database + def _init_options(self, **kwargs): + if "timezone" in kwargs: + _tz = kwargs["timezone"].encode("utf-8") + self._tz = _tz + set_tz(pytz.timezone(kwargs["timezone"])) + taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) - if port: - self._port = port or 0 + if "config" in kwargs: + _config = kwargs["config"].encode("utf-8") + self._config = _config + taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) - if timezone: - timezone = timezone.encode("utf-8") - self._tz = timezone + def _init_conn(self, **kwargs): + if "host" in kwargs: + _host = kwargs["host"].encode("utf-8") + self._host = _host - if config: - config = config.encode("utf-8") - self._config = config + if "user" in kwargs: + _user = kwargs["user"].encode("utf-8") + self._user = _user - self._init_options() - self._init_conn() - self._check_conn_error() + if "password" in kwargs: + _password = kwargs["password"].encode("utf-8") + self._password = _password - def _init_options(self): - if self._tz: - set_tz(pytz.timezone(self._tz.decode("utf-8"))) - taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) + if "database" in kwargs: + _database = kwargs["database"].encode("utf-8") + self._database = _database - if self._config: - taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + if "port" in kwargs: + self._port = int(kwargs.get("port", 0)) - def _init_conn(self): self._raw_conn = taos_connect(self._host, self._user, self._password, self._database, self._port) def _check_conn_error(self): errno = taos_errno(self._raw_conn) if errno != 0: - errstr = taos_errstr(self._raw_conn) + errstr = taos_errstr(self._raw_conn).decode("utf-8") raise ConnectionError(errstr, errno) def __dealloc__(self): @@ -143,9 +143,9 @@ cdef class TaosConnection: def select_db(self, str database): _database = database.encode("utf-8") - res = taos_select_db(self._raw_conn, _database) - if res != 0: - raise DatabaseError("select database error", res) + errno = taos_select_db(self._raw_conn, _database) + if errno != 0: + raise DatabaseError("select database error", errno) def execute(self, str sql, req_id: Optional[int] = None) -> int: return self.query(sql, req_id).affected_rows @@ -159,7 +159,7 @@ cdef class TaosConnection: errno = taos_errno(res) if errno != 0: - errstr = taos_errstr(res) + errstr = taos_errstr(res).decode("utf-8") taos_free_result(res) raise ProgrammingError(errstr, errno) @@ -189,16 +189,17 @@ cdef class TaosConnection: _sql = sql.encode("utf-8") errno = taos_stmt_prepare(stmt, _sql, len(_sql)) if errno != 0: - raise StatementError(taos_stmt_errstr(stmt), errno) + stmt_errstr = taos_stmt_errstr(stmt).decode("utf-8") + raise StatementError(stmt_errstr, errno) return TaosStmt(stmt) - def load_table_info(self, tables: List[str]): _tables = ",".join(tables).encode("utf-8") errno = taos_load_table_info(self._raw_conn, _tables) if errno != 0: - raise OperationalError(taos_errstr(NULL), errno) + errstr = taos_errstr(NULL).decode("utf-8") + raise OperationalError(errstr, errno) def close(self): if self._raw_conn is not NULL: @@ -321,7 +322,7 @@ cdef class TaosConnection: errno = taos_errno(res) affected_rows = taos_affected_rows(res) if errno != 0: - errstr = taos_errstr(res) + errstr = taos_errstr(res).decode("utf-8") taos_free_result(res) raise SchemalessError(errstr, errno, affected_rows) @@ -437,7 +438,7 @@ cdef class TaosConnection: errno = taos_errno(res) affected_rows = taos_affected_rows(res) if errno != 0: - errstr = taos_errstr(res) + errstr = taos_errstr(res).decode("utf-8") taos_free_result(res) raise SchemalessError(errstr, errno, affected_rows) @@ -470,7 +471,8 @@ cdef class TaosConnection: _table = table.encode("utf-8") errno = taos_get_table_vgId(self._raw_conn, _db, _table, &vg_id) if errno != 0: - raise InternalError(taos_errstr(NULL), errno) + errstr = taos_errstr(NULL).decode("utf-8") + raise InternalError(errstr, errno) return vg_id @@ -564,7 +566,7 @@ cdef class TaosResult: def _check_result_error(self): errno = taos_errno(self._res) if errno != 0: - errstr = taos_errstr(self._res) + errstr = taos_errstr(self._res).decode("utf-8") raise ProgrammingError(errstr, errno) def _fetch_block(self) -> Tuple[List, int]: @@ -942,7 +944,7 @@ cdef class Message: self._err_str = taos_errstr(self._res) def error(self) -> Optional[TmqError]: - return TmqError(self._err_str) if self._err_no else None + return TmqError(self._err_str.decode("utf-8"), self._err_no) if self._err_no else None def topic(self) -> Optional[str]: _topic = tmq_get_topic_name(self._res) @@ -1071,6 +1073,11 @@ cdef class TaosConsumer: self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) if self._tmq is NULL: raise TmqError("new tmq consumer failed") + + def _check_tmq_error(self, tmq_errno): + if tmq_errno != 0: + tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") + raise TmqError(tmq_errstr, tmq_errno) def subscribe(self, topics: List[str]): tmq_list = tmq_list_new() @@ -1081,20 +1088,21 @@ cdef class TaosConsumer: _tp = tp.encode("utf-8") tmq_errno = tmq_list_append(tmq_list, _tp) if tmq_errno != 0: + tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") tmq_list_destroy(tmq_list) - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + raise TmqError(tmq_errstr, tmq_errno) tmq_errno = tmq_subscribe(self._tmq, tmq_list) if tmq_errno != 0: + tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") tmq_list_destroy(tmq_list) - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + raise TmqError(tmq_errstr, tmq_errno) self._subscribed = True def unsubscribe(self): tmq_errno = tmq_unsubscribe(self._tmq) - if tmq_errno != 0: - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + self._check_tmq_error(tmq_errno) self._subscribed = False @@ -1128,7 +1136,8 @@ cdef class TaosConsumer: self.offsets_commit(offsets) return - tmq_commit_sync(self._tmq, NULL) + tmq_errno = tmq_commit_sync(self._tmq, NULL) + self._check_tmq_error(tmq_errno) async def commit_a(self, message: Message=None, offsets: List[TopicPartition]=None): if message: @@ -1142,27 +1151,23 @@ cdef class TaosConsumer: fut = loop.create_future() tmq_commit_async(self._tmq, NULL, async_commit_future_wrapper, fut) tmq_errno = await fut - if tmq_errno != 0: - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + self._check_tmq_error(tmq_errno) def message_commit(self, message: Message): tmq_errno = tmq_commit_sync(self._tmq, message._res) - if tmq_errno != 0: - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + self._check_tmq_error(tmq_errno) async def message_commit_a(self, message: Message): loop = asyncio.get_event_loop() fut = loop.create_future() tmq_commit_async(self._tmq, message._res, async_commit_future_wrapper, fut) tmq_errno = await fut - if tmq_errno != 0: - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + self._check_tmq_error(tmq_errno) def offsets_commit(self, topic_partitions: List[TopicPartition]): for tp in topic_partitions: tmq_errno = tmq_commit_offset_sync(self._tmq, tp._topic, tp._partition, tp._offset) - if tmq_errno != 0: - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + self._check_tmq_error(tmq_errno) async def offsets_commit_a(self, topic_partitions: List[TopicPartition]): loop = asyncio.get_event_loop() @@ -1174,8 +1179,7 @@ cdef class TaosConsumer: tmq_errnos = await asyncio.gather(futs, return_exceptions=True) for tmq_errno in tmq_errnos: - if tmq_errno != 0: - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + self._check_tmq_error(tmq_errno) def assignment(self) -> List[TopicPartition]: cdef int32_t i @@ -1188,8 +1192,9 @@ cdef class TaosConsumer: _topic = topic.encode("utf-8") tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &p_assignment, &num_of_assignment) if tmq_errno != 0: + tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") tmq_free_assignment(p_assignment) - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + raise TmqError(tmq_errstr, tmq_errno) for i in range(num_of_assignment): assignment = p_assignment[i] @@ -1205,8 +1210,7 @@ cdef class TaosConsumer: Set consume position for partition to offset. """ tmq_errno = tmq_offset_seek(self._tmq, partition._topic, partition._partition, partition._offset) - if tmq_errno != 0: - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + self._check_tmq_error(tmq_errno) def committed(self, partitions: List[TopicPartition]) -> List[TopicPartition]: """ @@ -1218,12 +1222,10 @@ cdef class TaosConsumer: """ for partition in partitions: if not isinstance(partition, TopicPartition): - raise TmqError(msg='Invalid partition type') + raise TmqError("Invalid partition type") - offset = tmq_committed(self._tmq, partition._topic, partition._partition) - - if offset < 0: - raise TmqError(tmq_err2str(offset), offset) + tmq_errno = offset = tmq_committed(self._tmq, partition._topic, partition._partition) + self._check_tmq_error(tmq_errno) partition._offset = offset @@ -1239,11 +1241,10 @@ cdef class TaosConsumer: """ for partition in partitions: if not isinstance(partition, TopicPartition): - raise TmqError(msg='Invalid partition type') - offset = tmq_position(self._tmq, partition._topic, partition._partition) + raise TmqError("Invalid partition type") - if offset < 0: - raise TmqError(tmq_err2str(offset), offset) + tmq_errno = offset = tmq_position(self._tmq, partition._topic, partition._partition) + self._check_tmq_error(tmq_errno) partition._offset = offset @@ -1253,8 +1254,7 @@ cdef class TaosConsumer: cdef int i cdef tmq_list_t *topics tmq_errno = tmq_subscription(self._tmq, &topics) - if tmq_errno != 0: - raise TmqError(tmq_err2str(tmq_errno), tmq_errno) + self._check_tmq_error(tmq_errno) n = tmq_list_get_size(topics) ca = tmq_list_to_c_array(topics) @@ -1285,7 +1285,8 @@ cdef class TaosStmt: def _check_stmt_error(self, int errno): if errno != 0: - raise StatementError(taos_stmt_errstr(self._stmt), errno) + stmt_errstr = taos_stmt_errstr(self._stmt).decode("utf-8") + raise StatementError(stmt_errstr, errno) def set_tbname(self, str name): if self._stmt is NULL: @@ -1297,7 +1298,7 @@ cdef class TaosStmt: def prepare(self, str sql): if self._stmt is NULL: - raise StatementError("Invalid use of set_tbname") + raise StatementError("Invalid use of prepare") _sql = sql.encode("utf-8") errno = taos_stmt_prepare(self._stmt, _sql, len(_sql)) @@ -1314,7 +1315,7 @@ cdef class TaosStmt: def bind_param(self, TaosMultiBinds binds, bool add_batch=True): if self._stmt is NULL: - raise StatementError("Invalid use of stmt") + raise StatementError("Invalid use of bind_param") errno = taos_stmt_bind_param(self._stmt, binds._binds) self._check_stmt_error(errno) @@ -1324,7 +1325,7 @@ cdef class TaosStmt: def bind_param_batch(self, TaosMultiBinds binds, bool add_batch=True): if self._stmt is NULL: - raise StatementError("Invalid use of stmt") + raise StatementError("Invalid use of bind_param_batch") errno = taos_stmt_bind_param_batch(self._stmt, binds._binds) self._check_stmt_error(errno) @@ -1334,7 +1335,7 @@ cdef class TaosStmt: def add_batch(self): if self._stmt is NULL: - raise StatementError("Invalid use of stmt") + raise StatementError("Invalid use of add_batch") errno = taos_stmt_add_batch(self._stmt) self._check_stmt_error(errno) @@ -1352,7 +1353,7 @@ cdef class TaosStmt: res = taos_stmt_use_result(self._stmt) if res is NULL: - raise StatementError(taos_stmt_errstr(self._stmt)) + raise StatementError(taos_stmt_errstr(self._stmt).decode("utf-8")) return TaosResult(res) @@ -1380,9 +1381,7 @@ cdef class TaosMultiBinds: def __cinit__(self, size_t size): self._size = size self._binds = malloc(size * sizeof(TAOS_MULTI_BIND)) - if self._binds is NULL: - raise MemoryError() - + _check_malloc(self._binds) memset(self._binds, 0, size * sizeof(TAOS_MULTI_BIND)) def __str__(self): @@ -1391,17 +1390,6 @@ cdef class TaosMultiBinds: def __repr__(self): return "TaosMultiBinds(size=%d)" % (self._size, ) - def describe(self): - if self._binds is NULL: - return - - for i in range(self._size): - buf_len = self._binds[i].num * self._binds[i].buffer_length - is_null_len = self._binds[i].num * sizeof(char) - buffer = ((self._binds[i].buffer))[:buf_len] - is_null = self._binds[i].is_null[:is_null_len] - print(i, buf_len, buffer, is_null_len, is_null) - def __getitem__(self, item): if item >= self._size: raise IndexError() @@ -1446,7 +1434,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(bool) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1465,7 +1455,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(int8_t) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1484,7 +1476,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(int16_t) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1503,7 +1497,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(int32_t) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1522,7 +1518,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(int64_t) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1541,7 +1539,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(float) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1561,7 +1561,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(double) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1581,7 +1583,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(uint8_t) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1600,7 +1604,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(uint16_t) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1619,7 +1625,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(uint32_t) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1638,7 +1646,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(uint64_t) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) for i in range(self._inner.num): v = values[i] @@ -1657,7 +1667,9 @@ cdef class TaosMultiBind: self._inner.buffer_length = sizeof(int64_t) self._inner.num = len(values) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch @@ -1692,8 +1704,11 @@ cdef class TaosMultiBind: self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) self._inner.num = len(values) _length = malloc(self._inner.num * sizeof(int32_t)) + _check_malloc(_length) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) buf_list = [] for i in range(self._inner.num): @@ -1720,8 +1735,11 @@ cdef class TaosMultiBind: self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) self._inner.num = len(values) _length = malloc(self._inner.num * sizeof(int32_t)) + _check_malloc(_length) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) buf_list = [] for i in range(self._inner.num): @@ -1748,8 +1766,11 @@ cdef class TaosMultiBind: self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) self._inner.num = len(values) _length = malloc(self._inner.num * sizeof(int32_t)) + _check_malloc(_length) _buffer = malloc(self._inner.num * self._inner.buffer_length) + _check_malloc(_buffer) _is_null = malloc(self._inner.num * sizeof(char)) + _check_malloc(_is_null) buf_list = [] for i in range(self._inner.num): From a03bf807f98f949d8b6121a91628d76ecb00c49e Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Thu, 7 Sep 2023 19:16:38 +0800 Subject: [PATCH 21/31] perf: using cython 1. add _constants.pyx 2.fix some bug 3.more async code 4.more doc 5. more annotation --- build.py | 8 + taos/_constants.pxd | 8 + taos/_constants.pyx | 81 ++++++++++ taos/_objects.pyx | 384 ++++++++++++++++++++++++++++++++++---------- 4 files changed, 397 insertions(+), 84 deletions(-) create mode 100644 taos/_constants.pxd create mode 100644 taos/_constants.pyx diff --git a/build.py b/build.py index bcff52f5..c61d1b4f 100644 --- a/build.py +++ b/build.py @@ -25,6 +25,9 @@ def build(setup_kwargs): Extension("taos._objects", ["taos/_objects.pyx"], libraries=["taos"], ), + Extension("taos._constants", ["taos/_constants.pyx"], + libraries=["taos"], + ), ] elif platform.system() == "Windows": extensions = [ @@ -39,6 +42,11 @@ def build(setup_kwargs): include_dirs=[r"C:\TDengine\include"], library_dirs=[r"C:\TDengine\driver"], ), + Extension("taos._constants", ["taos/_constants.pyx"], + libraries=["taos"], + include_dirs=[r"C:\TDengine\include"], + library_dirs=[r"C:\TDengine\driver"], + ), ] else: raise Exception("unsupported platform") diff --git a/taos/_constants.pxd b/taos/_constants.pxd new file mode 100644 index 00000000..17ba6876 --- /dev/null +++ b/taos/_constants.pxd @@ -0,0 +1,8 @@ +cdef class TaosOption: + """taos option""" + +cdef class SmlPrecision: + """Schemaless timestamp precision constants""" + +cdef class SmlProtocol: + """Schemaless protocol constants""" diff --git a/taos/_constants.pyx b/taos/_constants.pyx new file mode 100644 index 00000000..ece201e4 --- /dev/null +++ b/taos/_constants.pyx @@ -0,0 +1,81 @@ +from taos._cinterface cimport TSDB_OPTION, TSDB_SML_PROTOCOL_TYPE, TSDB_SML_TIMESTAMP_TYPE, tmq_conf_res_t, tmq_res_t + +cdef class TaosOption: + """taos option""" + Locale = TSDB_OPTION.TSDB_OPTION_LOCALE + Charset = TSDB_OPTION.TSDB_OPTION_CHARSET + Timezone = TSDB_OPTION.TSDB_OPTION_TIMEZONE + ConfigDir = TSDB_OPTION.TSDB_OPTION_CONFIGDIR + ShellActivityTimer = TSDB_OPTION.TSDB_OPTION_SHELL_ACTIVITY_TIMER + UseAdapter = TSDB_OPTION.TSDB_OPTION_USE_ADAPTER + MaxOptions = TSDB_OPTION.TSDB_MAX_OPTIONS + +cdef class SmlPrecision: + """Schemaless timestamp precision constants""" + NOT_CONFIGURED = TSDB_SML_TIMESTAMP_TYPE.TSDB_SML_TIMESTAMP_NOT_CONFIGURED + HOURS = TSDB_SML_TIMESTAMP_TYPE.TSDB_SML_TIMESTAMP_HOURS + MINUTES = TSDB_SML_TIMESTAMP_TYPE.TSDB_SML_TIMESTAMP_MINUTES + SECONDS = TSDB_SML_TIMESTAMP_TYPE.TSDB_SML_TIMESTAMP_SECONDS + MILLI_SECONDS = TSDB_SML_TIMESTAMP_TYPE.TSDB_SML_TIMESTAMP_MILLI_SECONDS + MICRO_SECONDS = TSDB_SML_TIMESTAMP_TYPE.TSDB_SML_TIMESTAMP_MICRO_SECONDS + NANO_SECONDS = TSDB_SML_TIMESTAMP_TYPE.TSDB_SML_TIMESTAMP_NANO_SECONDS + +cdef class SmlProtocol: + """Schemaless protocol constants""" + UNKNOWN_PROTOCOL = TSDB_SML_PROTOCOL_TYPE.TSDB_SML_UNKNOWN_PROTOCOL + LINE_PROTOCOL = TSDB_SML_PROTOCOL_TYPE.TSDB_SML_LINE_PROTOCOL + TELNET_PROTOCOL = TSDB_SML_PROTOCOL_TYPE.TSDB_SML_TELNET_PROTOCOL + JSON_PROTOCOL = TSDB_SML_PROTOCOL_TYPE.TSDB_SML_JSON_PROTOCOL + +cdef class TmqResultType: + INVALID = tmq_res_t.TMQ_RES_INVALID + DATA = tmq_res_t.TMQ_RES_DATA + TABLE_META = tmq_res_t.TMQ_RES_TABLE_META + METADATA = tmq_res_t.TMQ_RES_METADATA + +class PrecisionEnum: + """Precision enums""" + Milliseconds = 0 + Microseconds = 1 + Nanoseconds = 2 + +class FieldType: + """TDengine Field Types""" + + # type_code + C_NULL = 0 + C_BOOL = 1 + C_TINYINT = 2 + C_SMALLINT = 3 + C_INT = 4 + C_BIGINT = 5 + C_FLOAT = 6 + C_DOUBLE = 7 + C_VARCHAR = 8 + C_BINARY = 8 + C_TIMESTAMP = 9 + C_NCHAR = 10 + C_TINYINT_UNSIGNED = 11 + C_SMALLINT_UNSIGNED = 12 + C_INT_UNSIGNED = 13 + C_BIGINT_UNSIGNED = 14 + C_JSON = 15 + # NULL value definition + # NOTE: These values should change according to C definition in tsdb.h + C_BOOL_NULL = 0x02 + C_TINYINT_NULL = -128 + C_TINYINT_UNSIGNED_NULL = 255 + C_SMALLINT_NULL = -32768 + C_SMALLINT_UNSIGNED_NULL = 65535 + C_INT_NULL = -2147483648 + C_INT_UNSIGNED_NULL = 4294967295 + C_BIGINT_NULL = -9223372036854775808 + C_BIGINT_UNSIGNED_NULL = 18446744073709551615 + C_FLOAT_NULL = float('nan') + C_DOUBLE_NULL = float('nan') + C_BINARY_NULL = bytearray([int("0xff", 16)]) + # Timestamp precision definition + C_TIMESTAMP_MILLI = 0 + C_TIMESTAMP_MICRO = 1 + C_TIMESTAMP_NANO = 2 + C_TIMESTAMP_UNKNOWN = 3 \ No newline at end of file diff --git a/taos/_objects.pyx b/taos/_objects.pyx index e42239c5..1a5757b7 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -4,13 +4,14 @@ from libc.stdlib cimport malloc, free from libc.string cimport memset, strcpy, memcpy import ctypes import asyncio +import datetime as dt +import pytz +from collections import namedtuple from typing import Optional, List, Tuple, Dict, Iterator, AsyncIterator from taos._cinterface cimport * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC -import datetime as dt -import pytz -from collections import namedtuple +from taos._constants import TaosOption, SmlPrecision, SmlProtocol, TmqResultType, PrecisionEnum from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError, SchemalessError from taos.constants import FieldType @@ -65,7 +66,7 @@ cdef void async_block_future_wrapper(void *param, TAOS_RES *res, int num_of_rows with gil: taos_result, fut = param if num_of_rows > 0: - block, n = taos_result.fetch_block() + block, n = taos_result._fetch_block() else: block, n = [], 0 @@ -92,12 +93,12 @@ cdef class TaosConnection: _tz = kwargs["timezone"].encode("utf-8") self._tz = _tz set_tz(pytz.timezone(kwargs["timezone"])) - taos_options(TSDB_OPTION.TSDB_OPTION_TIMEZONE, self._tz) + taos_options(TaosOption.Timezone, self._tz) if "config" in kwargs: _config = kwargs["config"].encode("utf-8") self._config = _config - taos_options(TSDB_OPTION.TSDB_OPTION_CONFIGDIR, self._config) + taos_options(TaosOption.ConfigDir, self._config) def _init_conn(self, **kwargs): if "host" in kwargs: @@ -136,9 +137,9 @@ cdef class TaosConnection: @property def server_info(self) -> Optional[str]: - # type: () -> str if self._raw_conn is NULL: return + return taos_get_server_info(self._raw_conn).decode("utf-8") def select_db(self, str database): @@ -177,7 +178,7 @@ cdef class TaosConnection: res = await fut return res - def statement(self, sql: Optional[str]=None) -> TaosStmt: + def statement(self, sql: Optional[str]=None) -> Optional[TaosStmt]: if self._raw_conn is NULL: return None @@ -209,8 +210,8 @@ cdef class TaosConnection: def schemaless_insert( self, lines: List[str], - protocol: TSDB_SML_PROTOCOL_TYPE, - precision: TSDB_SML_TIMESTAMP_TYPE, + protocol: int, + precision: int, req_id: Optional[int] = None, ttl: Optional[int] = None, ) -> int: @@ -326,13 +327,13 @@ cdef class TaosConnection: taos_free_result(res) raise SchemalessError(errstr, errno, affected_rows) - return TaosResult(res) + return affected_rows def schemaless_insert_raw( self, lines: str, - protocol: TSDB_SML_PROTOCOL_TYPE, - precision: TSDB_SML_TIMESTAMP_TYPE, + protocol: int, + precision: int, req_id: Optional[int] = None, ttl: Optional[int] = None, ) -> int: @@ -442,11 +443,11 @@ cdef class TaosConnection: taos_free_result(res) raise SchemalessError(errstr, errno, affected_rows) - return TaosResult(res) + return affected_rows def commit(self): - """Commit any pending transaction to the database. - + """ + Commit any pending transaction to the database. Since TDengine do not support transactions, the implement is void functionality. """ pass @@ -513,6 +514,7 @@ cdef class TaosField: cdef class TaosResult: + """TDengine result interface""" cdef TAOS_RES *_res cdef TAOS_FIELD *_fields cdef list _taos_fields @@ -544,23 +546,28 @@ cdef class TaosResult: return self.rows_iter_a() @property - def fields(self): + def fields(self) -> List[TaosField]: + """fields definitions of the current result""" return self._taos_fields @property def field_count(self): + """the fields count of the current result""" return self._field_count @property def precision(self): + """the precision of the current result""" return self._precision @property def affected_rows(self): + """the affected_rows of the current result""" return self._affected_rows @property def row_count(self): + """the row_count of the object""" return self._row_count def _check_result_error(self): @@ -596,16 +603,39 @@ cdef class TaosResult: return blocks, abs(num_of_rows) + async def _fetch_block_a(self) -> Tuple[List, int]: + loop = asyncio.get_event_loop() + fut = loop.create_future() + param = (self, fut) + taos_fetch_rows_a(self._res, async_block_future_wrapper, param) + # taos_fetch_raw_block_a(self._res, async_block_future_wrapper, param) # FIXME: have some problem when parsing nchar + + block, n = await fut + return block, n + def fetch_block(self) -> Tuple[List, int]: if self._res is NULL: - raise OperationalError("Invalid use of fetch iterator") + raise OperationalError("Invalid use of fetch block") block, num_of_rows = self._fetch_block() self._row_count += num_of_rows return [r for r in map(tuple, zip(*block))], num_of_rows + async def fetch_block_a(self) -> Tuple[List, int]: + if self._res is NULL: + raise OperationalError("Invalid use of fetch block") + + block, num_of_rows = await self._fetch_block_a() + self._row_count += num_of_rows + + return [r for r in map(tuple, zip(*block))], num_of_rows + def fetch_all(self) -> List[Tuple]: + """ + fetch all data from taos result into python list + using `taos_fetch_block` + """ if self._res is NULL: raise OperationalError("Invalid use of fetchall") @@ -622,12 +652,36 @@ cdef class TaosResult: return [r for b in blocks for r in map(tuple, zip(*b))] + async def fetch_all_a(self) -> List[Tuple]: + """ + async fetch all data from taos result into python list + using `taos_fetch_block` + """ + if self._res is NULL: + raise OperationalError("Invalid use of fetchall") + + blocks = [] + while True: + block, num_of_rows = await self._fetch_block_a() + self._check_result_error() + + if num_of_rows == 0: + break + + self._row_count += num_of_rows + blocks.append(block) + + return [r for b in blocks for r in map(tuple, zip(*b))] + def fetch_all_into_dict(self) -> List[Dict]: + """ + fetch all data from taos result into python dict + using `taos_fetch_block` + """ if self._res is NULL: raise OperationalError("Invalid use of fetchall") field_names = [field.name for field in self.fields] - dict_row_cls = namedtuple('DictRow', field_names) blocks = [] while True: block, num_of_rows = self._fetch_block() @@ -639,9 +693,34 @@ cdef class TaosResult: self._row_count += num_of_rows blocks.append(block) - return [dict_row_cls(*r)._asdict() for b in blocks for r in map(tuple, zip(*b))] + return [dict((f, v) for f, v in zip(field_names, r)) for b in blocks for r in map(tuple, zip(*b))] + + async def fetch_all_into_dict_a(self) -> List[Dict]: + """ + async fetch all data from taos result into python dict + using `taos_fetch_block` + """ + if self._res is NULL: + raise OperationalError("Invalid use of fetchall") + + field_names = [field.name for field in self.fields] + blocks = [] + while True: + block, num_of_rows = await self._fetch_block_a() + self._check_result_error() + + if num_of_rows == 0: + break + + self._row_count += num_of_rows + blocks.append(block) + + return [dict((f, v) for f, v in zip(field_names, r)) for b in blocks for r in map(tuple, zip(*b))] def rows_iter(self) -> Iterator[Tuple]: + """ + Iterate row from taos result into python list + """ if self._res is NULL: raise OperationalError("Invalid use of rows_iter") @@ -670,9 +749,9 @@ cdef class TaosResult: pass self._row_count += 1 - yield row + yield tuple(row) # TODO: list -> tuple, too much object is create here - def blocks_iter(self) -> Iterator[Tuple[List, int]]: + def blocks_iter(self) -> Iterator[Tuple[List[Tuple], int]]: if self._res is NULL: raise OperationalError("Invalid use of rows_iter") @@ -701,35 +780,55 @@ cdef class TaosResult: for row in rows: yield row - async def blocks_iter_a(self) -> AsyncIterator[Tuple[List, int]]: + async def blocks_iter_a(self) -> AsyncIterator[Tuple[List[Tuple], int]]: if self._res is NULL: raise OperationalError("Invalid use of blocks_iter_a") - loop = asyncio.get_event_loop() while True: - fut = loop.create_future() - param = (self, fut) - taos_fetch_rows_a(self._res, async_block_future_wrapper, param) - # taos_fetch_raw_block_a(self._res, async_block_future_wrapper, param) # FIXME: have some problem when parsing nchar + block, num_of_rows = await self._fetch_block_a() - block, n = await fut - if not block: + if num_of_rows == 0: break - yield block, n + yield [r for r in map(tuple, zip(*block))], num_of_rows def stop_query(self): - return taos_stop_query(self._res) + if self._res is not NULL: + taos_stop_query(self._res) - def __dealloc__(self): + def close(self): if self._res is not NULL: taos_free_result(self._res) self._res = NULL + self._field_count self._fields = NULL + self._taos_fields = [] + + def __dealloc__(self): + self.close() cdef class TaosCursor: + """Database cursor which is used to manage the context of a fetch operation. + + Attributes: + .description: Read-only attribute consists of 7-item sequences: + + > name (mandatory) + > type_code (mandatory) + > display_size + > internal_size + > precision + > scale + > null_ok + + This attribute will be None for operations that do not return rows or + if the cursor has not had an operation invoked via the .execute*() method yet. + + .rowcount:This read-only attribute specifies the number of rows that the last + .execute*() produced (for DQL statements like SELECT) or affected + """ cdef list _description cdef TaosConnection _connection cdef TaosResult _result @@ -748,26 +847,31 @@ cdef class TaosCursor: return next(self) @property - def description(self): + def description(self) -> List[Tuple]: return self._description @property - def rowcount(self): + def rowcount(self) -> int: + """ + For INSERT statement, rowcount is assigned immediately after execute the statement. + For SELECT statement, rowcount will not get correct value until fetched all data. + """ return self._result.row_count @property - def affected_rows(self): + def affected_rows(self) -> int: """Return the rowcount of insertion""" return self._result.affected_rows def callproc(self, procname, *args): - """Call a stored database procedure with the given name. - + """ + Call a stored database procedure with the given name. Void functionality since no stored procedures. """ pass def close(self): + """Close the cursor.""" if self._connection is None: return False @@ -833,9 +937,16 @@ cdef class TaosCursor: return rows + def istype(self, col: int, data_type: str): + ft_name = "".join(["C ", data_type.upper()]).replace(" ", "_") + return self._description[col][1] == getattr(FieldType, ft_name) + def fetchall(self) -> List[Tuple]: return [r for r in self] + def stop_query(self): + self._result.stop_query() + def nextset(self): pass @@ -862,38 +973,37 @@ cdef void async_commit_future_wrapper(tmq_t *tmq, int32_t code, void *param) nog cdef class TopicPartition: - cdef char *_topic + cdef str _topic cdef int32_t _partition cdef int64_t _offset cdef int64_t _begin cdef int64_t _end def __cinit__(self, str topic, int32_t partition, int64_t offset, int64_t begin=0, int64_t end=0): - _topic = topic.encode("utf-8") - self._topic = _topic + self._topic = topic self._partition = partition self._offset = offset self._begin = begin self._end = end @property - def topic(self): - return self._topic.decode("utf-8") + def topic(self) -> str: + return self._topic @property - def partition(self): + def partition(self) -> int: return self._partition @property - def offset(self): + def offset(self) -> int: return self._offset @property - def begin(self): + def begin(self) -> int: return self._begin @property - def end(self): + def end(self) -> int: return self._end def __str__(self): @@ -907,7 +1017,10 @@ cdef class MessageBlock: cdef int _ncols cdef str _table - def __init__(self, block=None, fields=None, nrows=0, ncols=0, table=""): + def __init__(self, + block: Optional[List[Optional[List]]]=None, + fields: Optional[List[TaosField]]=None, + nrows: int=0, ncols: int=0, table: str=""): self._block = block or [] self._fields = fields or [] self._nrows = nrows @@ -915,18 +1028,33 @@ cdef class MessageBlock: self._table = table def fields(self) -> List[TaosField]: + """ + Get fields in message block + """ return self._fields def nrows(self) -> int: + """ + get total count of rows of message block + """ return self._nrows def ncols(self) -> int: + """ + get total count of rows of message block + """ return self._ncols def table(self) -> str: + """ + get table name of message block + """ return self._table def fetchall(self) -> List[Tuple]: + """ + get all data in message block + """ return [r for r in self] def __iter__(self) -> Iterator[Tuple]: @@ -944,14 +1072,31 @@ cdef class Message: self._err_str = taos_errstr(self._res) def error(self) -> Optional[TmqError]: + """ + The message object is also used to propagate errors and events, an application must check error() to determine + if the Message is a proper message (error() returns None) or an error or event (error() returns a TmqError + object) + + :rtype: None or :py:class:`TmqError + """ return TmqError(self._err_str.decode("utf-8"), self._err_no) if self._err_no else None def topic(self) -> Optional[str]: + """ + + :returns: topic name. + :rtype: str + """ _topic = tmq_get_topic_name(self._res) topic = None if _topic is NULL else _topic.decode("utf-8") return topic def database(self) -> Optional[str]: + """ + + :returns: database name. + :rtype: str + """ _db = tmq_get_db_name(self._res) db = None if _db is NULL else _db.decode("utf-8") return db @@ -960,6 +1105,10 @@ cdef class Message: return tmq_get_vgroup_id(self._res) def offset(self) -> int: + """ + :returns: message offset. + :rtype: int + """ return tmq_get_vgroup_offset(self._res) def _fetch_message_block(self) -> MessageBlock: @@ -998,8 +1147,13 @@ cdef class Message: return MessageBlock(block, fields, num_of_rows, field_count, table) def value(self) -> List[MessageBlock]: + """ + + :returns: message value (payload). + :rtype: list[MessageBlock] + """ res_type = tmq_get_res_type(self._res) - if res_type in (tmq_res_t.TMQ_RES_TABLE_META, tmq_res_t.TMQ_RES_INVALID): + if res_type in (TmqResultType.TABLE_META, TmqResultType.INVALID): return None # TODO: deal with meta data message_blocks = [] @@ -1080,6 +1234,10 @@ cdef class TaosConsumer: raise TmqError(tmq_errstr, tmq_errno) def subscribe(self, topics: List[str]): + """ + Set subscription to supplied list of topics. + :param list(str) topics: List of topics (strings) to subscribe to. + """ tmq_list = tmq_list_new() if tmq_list is NULL: raise TmqError("new tmq list failed!") @@ -1101,22 +1259,34 @@ cdef class TaosConsumer: self._subscribed = True def unsubscribe(self): + """ + Remove current subscription. + """ tmq_errno = tmq_unsubscribe(self._tmq) self._check_tmq_error(tmq_errno) self._subscribed = False def close(self): - if self._tmq_conf is not NULL: - tmq_conf_destroy(self._tmq_conf) - self._tmq_conf = NULL - + """ + Close down and terminate the Kafka Consumer. + """ if self._tmq is not NULL: - tmq_unsubscribe(self._tmq) - tmq_consumer_close(self._tmq) + tmq_errno = tmq_consumer_close(self._tmq) + self._check_tmq_error(tmq_errno) self._tmq = NULL def poll(self, float timeout=1.0) -> Optional[Message]: + """ + Consumes a single message and returns events. + + The application must check the returned `Message` object's `Message.error()` method to distinguish between + proper messages (error() returns None). + + :param float timeout: Maximum time to block waiting for message, event or callback (default: 1). (second) + :returns: A Message object or None on timeout + :rtype: `Message` or None + """ if not self._subscribed: raise TmqError("unsubscribe topic") @@ -1128,6 +1298,17 @@ cdef class TaosConsumer: return Message(res) def commit(self, message: Message=None, offsets: List[TopicPartition]=None): + """ + Commit a message. + + The `message` and `offsets` parameters are mutually exclusive. If neither is set, the current partition + assignment's offsets are used instead. Use this method to commit offsets if you have 'enable.auto.commit' set + to False. + + :param Message message: Commit the message's offset+1. Note: By convention, committed offsets reflect the next + message to be consumed, **not** the last message consumed. + :param list(TopicPartition) offsets: List of topic+partitions+offsets to commit. + """ if message: self.message_commit(message) return @@ -1140,6 +1321,17 @@ cdef class TaosConsumer: self._check_tmq_error(tmq_errno) async def commit_a(self, message: Message=None, offsets: List[TopicPartition]=None): + """ + Async commit a message. + + The `message` and `offsets` parameters are mutually exclusive. If neither is set, the current partition + assignment's offsets are used instead. Use this method to commit offsets if you have 'enable.auto.commit' set + to False. + + :param Message message: Commit the message's offset+1. Note: By convention, committed offsets reflect the next + message to be consumed, **not** the last message consumed. + :param list(TopicPartition) offsets: List of topic+partitions+offsets to commit. + """ if message: await self.message_commit_a(message) return @@ -1154,27 +1346,33 @@ cdef class TaosConsumer: self._check_tmq_error(tmq_errno) def message_commit(self, message: Message): + """ Commit with message """ tmq_errno = tmq_commit_sync(self._tmq, message._res) self._check_tmq_error(tmq_errno) async def message_commit_a(self, message: Message): + """ Async commit with message """ loop = asyncio.get_event_loop() fut = loop.create_future() tmq_commit_async(self._tmq, message._res, async_commit_future_wrapper, fut) tmq_errno = await fut self._check_tmq_error(tmq_errno) - def offsets_commit(self, topic_partitions: List[TopicPartition]): - for tp in topic_partitions: - tmq_errno = tmq_commit_offset_sync(self._tmq, tp._topic, tp._partition, tp._offset) + def offsets_commit(self, partitions: List[TopicPartition]): + """ Commit with topic partitions """ + for tp in partitions: + _tp = tp._topic.encode("utf-8") + tmq_errno = tmq_commit_offset_sync(self._tmq, _tp, tp._partition, tp._offset) self._check_tmq_error(tmq_errno) - async def offsets_commit_a(self, topic_partitions: List[TopicPartition]): + async def offsets_commit_a(self, partitions: List[TopicPartition]): + """ async commit with topic partitions """ loop = asyncio.get_event_loop() futs = [] - for tp in topic_partitions: + for tp in partitions: + _tp = tp._topic.encode("utf-8") fut = loop.create_future() - tmq_commit_offset_async(self._tmq, tp._topic, tp._partition, tp._offset, async_commit_future_wrapper, fut) + tmq_commit_offset_async(self._tmq, _tp, tp._partition, tp._offset, async_commit_future_wrapper, fut) futs.append(fut) tmq_errnos = await asyncio.gather(futs, return_exceptions=True) @@ -1182,6 +1380,9 @@ cdef class TaosConsumer: self._check_tmq_error(tmq_errno) def assignment(self) -> List[TopicPartition]: + """ + Returns the current partition assignment as a list of TopicPartition tuples. + """ cdef int32_t i cdef int32_t num_of_assignment cdef tmq_topic_assignment *p_assignment = NULL @@ -1209,7 +1410,8 @@ cdef class TaosConsumer: """ Set consume position for partition to offset. """ - tmq_errno = tmq_offset_seek(self._tmq, partition._topic, partition._partition, partition._offset) + _tp = partition._topic.encode("utf-8") + tmq_errno = tmq_offset_seek(self._tmq, _tp, partition._partition, partition._offset) self._check_tmq_error(tmq_errno) def committed(self, partitions: List[TopicPartition]) -> List[TopicPartition]: @@ -1224,7 +1426,8 @@ cdef class TaosConsumer: if not isinstance(partition, TopicPartition): raise TmqError("Invalid partition type") - tmq_errno = offset = tmq_committed(self._tmq, partition._topic, partition._partition) + _tp = partition._topic.encode("utf-8") + tmq_errno = offset = tmq_committed(self._tmq, _tp, partition._partition) self._check_tmq_error(tmq_errno) partition._offset = offset @@ -1243,7 +1446,8 @@ cdef class TaosConsumer: if not isinstance(partition, TopicPartition): raise TmqError("Invalid partition type") - tmq_errno = offset = tmq_position(self._tmq, partition._topic, partition._partition) + _tp = partition._topic.encode("utf-8") + tmq_errno = offset = tmq_position(self._tmq, _tp, partition._partition) self._check_tmq_error(tmq_errno) partition._offset = offset @@ -1251,18 +1455,27 @@ cdef class TaosConsumer: return partitions def list_topics(self) -> List[str]: + """ + Request subscription topics from the tmq. + + :rtype: topics list + """ cdef int i - cdef tmq_list_t *topics - tmq_errno = tmq_subscription(self._tmq, &topics) + tmq_list = tmq_list_new() + if tmq_list is NULL: + raise TmqError("new tmq list failed!") + + tmq_errno = tmq_subscription(self._tmq, &tmq_list) self._check_tmq_error(tmq_errno) - n = tmq_list_get_size(topics) - ca = tmq_list_to_c_array(topics) + ca = tmq_list_to_c_array(tmq_list) + n = tmq_list_get_size(tmq_list) + tp_list = [] for i in range(n): - tp_list.append(ca[i]) + tp_list.append(ca[i].decode("utf-8")) - tmq_list_destroy(topics) + tmq_list_destroy(tmq_list) return tp_list @@ -1273,6 +1486,9 @@ cdef class TaosConsumer: yield message def __dealloc__(self): + if self._tmq_conf is not NULL: + tmq_conf_destroy(self._tmq_conf) + self._tmq_conf = NULL self.close() # ---------------------------------------- statement --------------------------------------------------------------- ^ @@ -1358,7 +1574,7 @@ cdef class TaosStmt: return TaosResult(res) @property - def affected_rows(self): + def affected_rows(self) -> int: # type: () -> int return taos_stmt_affected_rows(self._stmt) @@ -1662,7 +1878,7 @@ cdef class TaosMultiBind: self._inner.buffer = _buffer self._inner.is_null = _is_null - def timestamp(self, values, precision): + def timestamp(self, values, precision=PrecisionEnum.Milliseconds): self._inner.buffer_type = FieldType.C_TIMESTAMP self._inner.buffer_length = sizeof(int64_t) self._inner.num = len(values) @@ -1710,19 +1926,19 @@ cdef class TaosMultiBind: _is_null = malloc(self._inner.num * sizeof(char)) _check_malloc(_is_null) - buf_list = [] + _buf = bytearray(self._inner.num * self._inner.buffer_length) for i in range(self._inner.num): + offset = i * self._inner.buffer_length v = _bytes[i] if v is None: - buf_list.append(ctypes.create_string_buffer(self._inner.buffer_length).raw) + # _buf[offset:offset+self._inner.buffer_length] = b"\x00" * self._inner.buffer_length _is_null[i] = 1 _length[i] = 0 else: - buf_list.append(ctypes.create_string_buffer(v, self._inner.buffer_length).raw) + _buf[offset:offset+len(v)] = v _is_null[i] = 0 _length[i] = len(v) - _buf = b"".join(buf_list) memcpy(_buffer, _buf, self._inner.num * self._inner.buffer_length) self._inner.buffer = _buffer @@ -1741,19 +1957,19 @@ cdef class TaosMultiBind: _is_null = malloc(self._inner.num * sizeof(char)) _check_malloc(_is_null) - buf_list = [] + _buf = bytearray(self._inner.num * self._inner.buffer_length) for i in range(self._inner.num): + offset = i * self._inner.buffer_length v = _bytes[i] if v is None: - buf_list.append(ctypes.create_string_buffer(self._inner.buffer_length).raw) + # _buf[offset:offset+self._inner.buffer_length] = b"\x00" * self._inner.buffer_length _is_null[i] = 1 _length[i] = 0 else: - buf_list.append(ctypes.create_string_buffer(v, self._inner.buffer_length).raw) + _buf[offset:offset+len(v)] = v _is_null[i] = 0 _length[i] = len(v) - _buf = b"".join(buf_list) memcpy(_buffer, _buf, self._inner.num * self._inner.buffer_length) self._inner.buffer = _buffer @@ -1772,19 +1988,19 @@ cdef class TaosMultiBind: _is_null = malloc(self._inner.num * sizeof(char)) _check_malloc(_is_null) - buf_list = [] + _buf = bytearray(self._inner.num * self._inner.buffer_length) for i in range(self._inner.num): + offset = i * self._inner.buffer_length v = _bytes[i] if v is None: - buf_list.append(ctypes.create_string_buffer(self._inner.buffer_length).raw) + # _buf[offset:offset+self._inner.buffer_length] = b"\x00" * self._inner.buffer_length _is_null[i] = 1 _length[i] = 0 else: - buf_list.append(ctypes.create_string_buffer(v, self._inner.buffer_length).raw) + _buf[offset:offset+len(v)] = v _is_null[i] = 0 _length[i] = len(v) - _buf = b"".join(buf_list) memcpy(_buffer, _buf, self._inner.num * self._inner.buffer_length) self._inner.buffer = _buffer From 20989b29be3777afa2a098bb51d9170cc1a6cc85 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Fri, 8 Sep 2023 15:02:43 +0800 Subject: [PATCH 22/31] perf: using cython 1. add TaosResult._is_async 2.add validate_sql --- taos/_cinterface.pxd | 1 + taos/_objects.pyx | 150 ++++++++++++++++++++++++++++--------------- 2 files changed, 101 insertions(+), 50 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index d01faecc..37bf304c 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -71,6 +71,7 @@ cdef extern from "taos.h": int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) int taos_result_precision(TAOS_RES *res) int *taos_get_column_data_offset(TAOS_RES *res, int columnIndex) + int taos_validate_sql(TAOS *taos, const char *sql) int taos_errno(TAOS_RES *res) char *taos_errstr(TAOS_RES *res) TAOS *taos_connect(const char *ip, const char *user, const char *password, const char *db, uint16_t port) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 1a5757b7..5a34574a 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -42,7 +42,7 @@ cdef void async_result_future_wrapper(void *param, TAOS_RES *res, int code) nogi e = ProgrammingError(errstr, code) fut.get_loop().call_soon_threadsafe(fut.set_exception, e) else: - taos_result = TaosResult(res) + taos_result = TaosResult(res, is_async=True) fut.get_loop().call_soon_threadsafe(fut.set_result, taos_result) @@ -52,7 +52,8 @@ cdef void async_rows_future_wrapper(void *param, TAOS_RES *res, int num_of_rows) taos_result, fut = param rows = [] if num_of_rows > 0: - for row in taos_result.rows_iter(): + while True: + row = taos_result._fetch_row() rows.append(row) i += 1 if i >= num_of_rows: @@ -83,7 +84,7 @@ cdef class TaosConnection: cdef char *_config cdef TAOS *_raw_conn - def __cinit__(self, **kwargs): + def __cinit__(self, *args, **kwargs): self._init_options(**kwargs) self._init_conn(**kwargs) self._check_conn_error() @@ -142,6 +143,11 @@ cdef class TaosConnection: return taos_get_server_info(self._raw_conn).decode("utf-8") + def validate_sql(self, str sql) -> bool: + _sql = sql.encode("utf-8") + errno = taos_validate_sql(self._raw_conn, _sql) + return errno == 0 + def select_db(self, str database): _database = database.encode("utf-8") errno = taos_select_db(self._raw_conn, _database) @@ -522,8 +528,10 @@ cdef class TaosResult: cdef int _precision cdef int _row_count cdef int _affected_rows + cdef object _dt_epoch + cdef bool _is_async - def __cinit__(self, size_t res): + def __cinit__(self, size_t res, bool is_async=False): self._res = res self._check_result_error() self._field_count = taos_field_count(self._res) @@ -531,7 +539,9 @@ cdef class TaosResult: self._taos_fields = [TaosField(f.name.decode("utf-8"), f.type, f.bytes) for f in self._fields[:self._field_count]] self._precision = taos_result_precision(self._res) self._affected_rows = taos_affected_rows(self._res) - self._row_count = 0 + self._row_count = self._affected_rows if self._field_count == 0 else 0 + self._dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + self._is_async = is_async def __str__(self): return "TaosResult(field_count=%d, precision=%d, affected_rows=%d, row_count=%d)" % (self._field_count, self._precision, self._affected_rows, self._row_count) @@ -583,7 +593,6 @@ cdef class TaosResult: return [], 0 blocks = [None] * self._field_count - dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch cdef int i for i in range(self._field_count): data = pblock[i] @@ -597,12 +606,39 @@ cdef class TaosResult: blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, dt_epoch) + blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, self._dt_epoch) else: pass + self._row_count += num_of_rows return blocks, abs(num_of_rows) + def _fetch_row(self) -> Optional[Tuple]: + cdef TAOS_ROW taos_row + cdef int i + cdef int[1] offsets = [-2] + is_null = [False] + + taos_row = taos_fetch_row(self._res) + if taos_row is NULL: + return None + + row = [None] * self._field_count + for i in range(self._field_count): + data = taos_row[i] + field = self._fields[i] + if field.type in UNSIZED_TYPE: + row[i] = _parse_string(data, 1, offsets)[0] if data is not NULL else None # FIXME: is it ok to set offsets = [-2] here + elif field.type in SIZED_TYPE: + row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] if data is not NULL else None + elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + row[i] = _parse_timestamp(data, 1, is_null, self._precision, self._dt_epoch)[0] if data is not NULL else None + else: + pass + + self._row_count += 1 + return tuple(row) # TODO: list -> tuple, too much object is create here + async def _fetch_block_a(self) -> Tuple[List, int]: loop = asyncio.get_event_loop() fut = loop.create_future() @@ -613,21 +649,35 @@ cdef class TaosResult: block, n = await fut return block, n + async def _fetch_rows_a(self) -> List[Tuple]: + loop = asyncio.get_event_loop() + fut = loop.create_future() + param = (self, fut) + taos_fetch_rows_a(self._res, async_rows_future_wrapper, param) + rows = await fut + return rows + def fetch_block(self) -> Tuple[List, int]: if self._res is NULL: - raise OperationalError("Invalid use of fetch block") + raise OperationalError("Invalid use of fetch_block") + + if self._is_async: + raise OperationalError("Invalid use of fetch_block, async result can not use sync func") block, num_of_rows = self._fetch_block() - self._row_count += num_of_rows + self._check_result_error() return [r for r in map(tuple, zip(*block))], num_of_rows async def fetch_block_a(self) -> Tuple[List, int]: if self._res is NULL: - raise OperationalError("Invalid use of fetch block") + raise OperationalError("Invalid use of fetch_block_a") + + if not self._is_async: + raise OperationalError("Invalid use of fetch_block_a, sync result can not use async func") block, num_of_rows = await self._fetch_block_a() - self._row_count += num_of_rows + self._check_result_error() return [r for r in map(tuple, zip(*block))], num_of_rows @@ -639,16 +689,18 @@ cdef class TaosResult: if self._res is NULL: raise OperationalError("Invalid use of fetchall") + if self._is_async: + raise OperationalError("Invalid use of fetch_all, async result can not use sync func") + blocks = [] while True: block, num_of_rows = self._fetch_block() - self._check_result_error() if num_of_rows == 0: break - self._row_count += num_of_rows blocks.append(block) + self._check_result_error() return [r for b in blocks for r in map(tuple, zip(*b))] @@ -658,18 +710,20 @@ cdef class TaosResult: using `taos_fetch_block` """ if self._res is NULL: - raise OperationalError("Invalid use of fetchall") + raise OperationalError("Invalid use of fetch_all_a") + + if not self._is_async: + raise OperationalError("Invalid use of fetch_all_a, sync result can not use async func") blocks = [] while True: block, num_of_rows = await self._fetch_block_a() - self._check_result_error() if num_of_rows == 0: break - self._row_count += num_of_rows blocks.append(block) + self._check_result_error() return [r for b in blocks for r in map(tuple, zip(*b))] @@ -679,20 +733,21 @@ cdef class TaosResult: using `taos_fetch_block` """ if self._res is NULL: - raise OperationalError("Invalid use of fetchall") + raise OperationalError("Invalid use of fetch_all_into_dict") + + if self._is_async: + raise OperationalError("Invalid use of fetch_all_into_dict, async result can not use sync func") field_names = [field.name for field in self.fields] blocks = [] while True: block, num_of_rows = self._fetch_block() - self._check_result_error() if num_of_rows == 0: break - self._row_count += num_of_rows blocks.append(block) - + self._check_result_error() return [dict((f, v) for f, v in zip(field_names, r)) for b in blocks for r in map(tuple, zip(*b))] async def fetch_all_into_dict_a(self) -> List[Dict]: @@ -701,19 +756,21 @@ cdef class TaosResult: using `taos_fetch_block` """ if self._res is NULL: - raise OperationalError("Invalid use of fetchall") + raise OperationalError("Invalid use of fetch_all_into_dict_a") + + if not self._is_async: + raise OperationalError("Invalid use of fetch_all_into_dict_a, sync result can not use async func") field_names = [field.name for field in self.fields] blocks = [] while True: block, num_of_rows = await self._fetch_block_a() - self._check_result_error() if num_of_rows == 0: break - self._row_count += num_of_rows blocks.append(block) + self._check_result_error() return [dict((f, v) for f, v in zip(field_names, r)) for b in blocks for r in map(tuple, zip(*b))] @@ -724,37 +781,25 @@ cdef class TaosResult: if self._res is NULL: raise OperationalError("Invalid use of rows_iter") - cdef TAOS_ROW taos_row - cdef int i - cdef int[1] offsets = [-2] - dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - is_null = [False] + if self._is_async: + raise OperationalError("Invalid use of rows_iter, async result can not use sync func") while True: - taos_row = taos_fetch_row(self._res) - if taos_row is NULL: + row = self._fetch_row() + + if row is None: break - row = [None] * self._field_count - for i in range(self._field_count): - data = taos_row[i] - field = self._fields[i] - if field.type in UNSIZED_TYPE: - row[i] = _parse_string(data, 1, offsets)[0] if data is not NULL else None # FIXME: is it ok to set offsets = [-2] here - elif field.type in SIZED_TYPE: - row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] if data is not NULL else None - elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - row[i] = _parse_timestamp(data, 1, is_null, self._precision, dt_epoch)[0] if data is not NULL else None - else: - pass - - self._row_count += 1 - yield tuple(row) # TODO: list -> tuple, too much object is create here + yield row + self._check_result_error() def blocks_iter(self) -> Iterator[Tuple[List[Tuple], int]]: if self._res is NULL: raise OperationalError("Invalid use of rows_iter") + if self._is_async: + raise OperationalError("Invalid use of rows_iter, async result can not use sync func") + while True: block, num_of_rows = self._fetch_block() @@ -762,28 +807,32 @@ cdef class TaosResult: break yield [r for r in map(tuple, zip(*block))], num_of_rows + self._check_result_error() async def rows_iter_a(self) -> AsyncIterator[Tuple]: if self._res is NULL: raise OperationalError("Invalid use of rows_iter_a") - loop = asyncio.get_event_loop() + if not self._is_async: + raise OperationalError("Invalid use of rows_iter_a, sync result can not use async func") + while True: - fut = loop.create_future() - param = (self, fut) - taos_fetch_rows_a(self._res, async_rows_future_wrapper, param) + rows = await self._fetch_rows_a() - rows = await fut if not rows: break for row in rows: yield row + self._check_result_error() async def blocks_iter_a(self) -> AsyncIterator[Tuple[List[Tuple], int]]: if self._res is NULL: raise OperationalError("Invalid use of blocks_iter_a") + if not self._is_async: + raise OperationalError("Invalid use of blocks_iter_a, sync result can not use async func") + while True: block, num_of_rows = await self._fetch_block_a() @@ -791,6 +840,7 @@ cdef class TaosResult: break yield [r for r in map(tuple, zip(*block))], num_of_rows + self._check_result_error() def stop_query(self): if self._res is not NULL: From bdad5f79ea7122fa326e5d363329b6cdbd6bbb55 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Fri, 8 Sep 2023 18:37:19 +0800 Subject: [PATCH 23/31] perf: using cython 1.improve taos_get_column_data_is_null --- taos/_cinterface.pxd | 2 +- taos/_cinterface.pyx | 25 ++++++------ taos/_objects.pyx | 28 +++++++------ taos/_parser.pxd | 32 ++++++++------- taos/_parser.pyx | 93 +++++++++++++++++++++++++++++--------------- 5 files changed, 111 insertions(+), 69 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 37bf304c..527bd5b9 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -173,5 +173,5 @@ cdef extern from "taos.h": const char *tmq_get_table_name(TAOS_RES *res) tmq_res_t tmq_get_res_type(TAOS_RES *res) -cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows) +cdef bool *taos_get_column_data_is_null(TAOS_RES *res, int field, int rows) cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, object dt_epoch) diff --git a/taos/_cinterface.pyx b/taos/_cinterface.pyx index bc7b9b76..5699d65f 100644 --- a/taos/_cinterface.pyx +++ b/taos/_cinterface.pyx @@ -1,5 +1,6 @@ # cython: profile=True +from libc.stdlib cimport malloc, free import cython import datetime as dt import pytz @@ -8,11 +9,11 @@ from taos.error import ProgrammingError, OperationalError, ConnectionError, Data from taos._parser cimport (_parse_bool, _parse_int8_t, _parse_int16_t, _parse_int, _parse_int64_t, _parse_float, _parse_double, _parse_timestamp, _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string) -cdef list taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): - cdef list is_null = [] +cdef bool *taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): + is_null = malloc(rows * sizeof(bool)) cdef int r for r in range(rows): - is_null.append(taos_is_null(res, r, field)) + is_null[r] = taos_is_null(res, r, field) return is_null @@ -50,19 +51,19 @@ CONVERT_FUNC = { TSDB_DATA_TYPE_BIGINT: _parse_int64_t, TSDB_DATA_TYPE_FLOAT: _parse_float, TSDB_DATA_TYPE_DOUBLE: _parse_double, - TSDB_DATA_TYPE_VARCHAR: None, + TSDB_DATA_TYPE_VARCHAR: _parse_string, TSDB_DATA_TYPE_TIMESTAMP: _parse_timestamp, - TSDB_DATA_TYPE_NCHAR: None, + TSDB_DATA_TYPE_NCHAR: _parse_string, TSDB_DATA_TYPE_UTINYINT: _parse_uint8_t, TSDB_DATA_TYPE_USMALLINT: _parse_uint16_t, TSDB_DATA_TYPE_UINT: _parse_uint, TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, - TSDB_DATA_TYPE_JSON: None, - TSDB_DATA_TYPE_VARBINARY: None, + TSDB_DATA_TYPE_JSON: _parse_string, + TSDB_DATA_TYPE_VARBINARY: _parse_string, TSDB_DATA_TYPE_DECIMAL: None, TSDB_DATA_TYPE_BLOB: None, TSDB_DATA_TYPE_MEDIUMBLOB: None, - TSDB_DATA_TYPE_BINARY: None, + TSDB_DATA_TYPE_BINARY: _parse_string, TSDB_DATA_TYPE_GEOMETRY: None, } @@ -83,13 +84,15 @@ cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_ if field.type in UNSIZED_TYPE: offsets = taos_get_column_data_offset(res, i) - blocks[i] = _parse_string(data, num_of_rows, offsets) + blocks[i] = _parse_string(data, num_of_rows, offsets) elif field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(res, i, num_of_rows) - blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + free(is_null) elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): is_null = taos_get_column_data_is_null(res, i, num_of_rows) - blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + free(is_null) else: pass diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 5a34574a..fac008a6 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -9,7 +9,7 @@ import pytz from collections import namedtuple from typing import Optional, List, Tuple, Dict, Iterator, AsyncIterator from taos._cinterface cimport * -from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string +from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string, _parse_raw_timestamp from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC from taos._constants import TaosOption, SmlPrecision, SmlProtocol, TmqResultType, PrecisionEnum from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError, SchemalessError @@ -600,13 +600,16 @@ cdef class TaosResult: if field.type in UNSIZED_TYPE: offsets = taos_get_column_data_offset(self._res, i) - blocks[i] = _parse_string(data, num_of_rows, offsets) + blocks[i] = _parse_string(data, num_of_rows, offsets) elif field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + free(is_null) elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, self._dt_epoch) + blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, self._dt_epoch) + free(is_null) + # blocks[i] = _parse_raw_timestamp(data, num_of_rows, is_null) else: pass @@ -617,7 +620,7 @@ cdef class TaosResult: cdef TAOS_ROW taos_row cdef int i cdef int[1] offsets = [-2] - is_null = [False] + cdef bool[1] is_null = [False] taos_row = taos_fetch_row(self._res) if taos_row is NULL: @@ -628,11 +631,12 @@ cdef class TaosResult: data = taos_row[i] field = self._fields[i] if field.type in UNSIZED_TYPE: - row[i] = _parse_string(data, 1, offsets)[0] if data is not NULL else None # FIXME: is it ok to set offsets = [-2] here + row[i] = _parse_string(data, 1, offsets)[0] if data is not NULL else None # FIXME: is it ok to set offsets = [-2] here elif field.type in SIZED_TYPE: - row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] if data is not NULL else None + row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] if data is not NULL else None elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - row[i] = _parse_timestamp(data, 1, is_null, self._precision, self._dt_epoch)[0] if data is not NULL else None + row[i] = _parse_timestamp(data, 1, is_null, self._precision, self._dt_epoch)[0] if data is not NULL else None + # row[i] = _parse_raw_timestamp(data, 1, is_null)[0] else: pass @@ -1184,13 +1188,15 @@ cdef class Message: if field.type in UNSIZED_TYPE: offsets = taos_get_column_data_offset(self._res, i) - block[i] = _parse_string(data, num_of_rows, offsets) + block[i] = _parse_string(data, num_of_rows, offsets) elif field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - block[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + block[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + free(is_null) elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - block[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + block[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + free(is_null) else: pass diff --git a/taos/_parser.pxd b/taos/_parser.pxd index d1cc1975..4bd07b78 100644 --- a/taos/_parser.pxd +++ b/taos/_parser.pxd @@ -5,32 +5,34 @@ cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length) cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length) -cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets) +cdef list _parse_string(size_t ptr, int num_of_rows, size_t offsets) -cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_bool(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_int8_t(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_int16_t(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_int32_t(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_int64_t(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_uint8_t(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_uint16_t(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_uint32_t(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_uint64_t(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_int(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_int(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_uint(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_float(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_float(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_double(size_t ptr, int num_of_rows, list is_null) +cdef list _parse_double(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, object dt_epoch) \ No newline at end of file +cdef list _parse_timestamp(size_t ptr, int num_of_rows, size_t is_null, int precision, object dt_epoch) + +cdef list _parse_raw_timestamp(size_t ptr, int num_of_rows, size_t is_null) \ No newline at end of file diff --git a/taos/_parser.pyx b/taos/_parser.pyx index 5792512f..b294452b 100644 --- a/taos/_parser.pyx +++ b/taos/_parser.pyx @@ -1,3 +1,5 @@ +# cython: profile=True + import datetime as dt cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length): @@ -20,16 +22,17 @@ cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): return res -cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): +cdef list _parse_string(size_t ptr, int num_of_rows, size_t offsets): cdef list res = [] cdef int i cdef size_t rbyte_ptr cdef size_t c_char_ptr + cdef int *_offset = offsets for i in range(abs(num_of_rows)): - if offsets[i] == -1: + if _offset[i] == -1: res.append(None) else: - rbyte_ptr = ptr + offsets[i] + rbyte_ptr = ptr + _offset[i] rbyte = (rbyte_ptr)[0] c_char_ptr = rbyte_ptr + sizeof(uint16_t) py_string = (c_char_ptr)[:rbyte].decode("utf-8") @@ -37,169 +40,183 @@ cdef list _parse_string(size_t ptr, int num_of_rows, int *offsets): return res -cdef list _parse_bool(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_bool(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_int8_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int8_t(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_int16_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int16_t(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_int32_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int32_t(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_int64_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int64_t(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_uint8_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint8_t(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_uint16_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint16_t(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_uint32_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint32_t(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_uint64_t(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint64_t(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_int(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_int(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_uint(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_uint(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_float(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_float(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_double(size_t ptr, int num_of_rows, list is_null): +cdef list _parse_double(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i + cdef bool *_is_null = is_null v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: res.append(v_ptr[i]) return res -cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precision, dt_epoch): +cdef list _parse_timestamp(size_t ptr, int num_of_rows, size_t is_null, int precision, object dt_epoch): cdef list res = [] cdef int i + cdef bool *_is_null = is_null cdef double denom = 10**((precision + 1) * 3) v_ptr = ptr for i in range(abs(num_of_rows)): - if is_null[i]: + if _is_null[i]: res.append(None) else: raw_value = v_ptr[i] @@ -209,3 +226,17 @@ cdef list _parse_timestamp(size_t ptr, int num_of_rows, list is_null, int precis _dt = raw_value res.append(_dt) return res + + +cdef list _parse_raw_timestamp(size_t ptr, int num_of_rows, size_t is_null): + cdef list res = [] + cdef int i + cdef bool *_is_null = is_null + v_ptr = ptr + for i in range(abs(num_of_rows)): + if _is_null[i]: + res.append(None) + else: + raw_value = v_ptr[i] + res.append(raw_value) + return res \ No newline at end of file From 1ab737253b0a42fcd4cc61ec6a5f2fc2e2bd5ad2 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Tue, 12 Sep 2023 14:41:38 +0800 Subject: [PATCH 24/31] perf: using cython 1.add tmq auto commit callback 2.free heap data properly --- taos/_cinterface.pxd | 2 + taos/_objects.pyx | 237 +++++++++++++++++++++++++++++-------------- 2 files changed, 161 insertions(+), 78 deletions(-) diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 527bd5b9..384b5cb6 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -79,6 +79,7 @@ cdef extern from "taos.h": int taos_options(TSDB_OPTION option, const void *arg, ...) const char *taos_get_client_info() const char *taos_get_server_info(TAOS *taos) + int taos_get_current_db(TAOS *taos, char *database, int len, int *required) int taos_select_db(TAOS *taos, const char *db) TAOS_RES *taos_query(TAOS *taos, const char *sql) TAOS_RES *taos_query_with_reqid(TAOS *taos, const char *sql, int64_t reqId) @@ -135,6 +136,7 @@ cdef extern from "taos.h": tmq_conf_t *tmq_conf_new() tmq_conf_res_t tmq_conf_set(tmq_conf_t *conf, const char *key, const char *value) void tmq_conf_destroy(tmq_conf_t *conf) + void tmq_conf_set_auto_commit_cb(tmq_conf_t *conf, tmq_commit_cb *cb, void *param) tmq_list_t *tmq_list_new() int32_t tmq_list_append(tmq_list_t *, const char *) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index fac008a6..5ffcf4e4 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -6,8 +6,9 @@ import ctypes import asyncio import datetime as dt import pytz +import inspect from collections import namedtuple -from typing import Optional, List, Tuple, Dict, Iterator, AsyncIterator +from typing import Optional, List, Tuple, Dict, Iterator, AsyncIterator, Callable from taos._cinterface cimport * from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string, _parse_raw_timestamp from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC @@ -15,6 +16,7 @@ from taos._constants import TaosOption, SmlPrecision, SmlProtocol, TmqResultType from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError, SchemalessError from taos.constants import FieldType +DB_MAX_LEN = 64 _priv_tz = None _utc_tz = pytz.timezone("UTC") try: @@ -83,8 +85,11 @@ cdef class TaosConnection: cdef char *_tz cdef char *_config cdef TAOS *_raw_conn + cdef char *_current_db def __cinit__(self, *args, **kwargs): + self._current_db = malloc(DB_MAX_LEN * sizeof(char)) + _check_malloc(self._current_db) self._init_options(**kwargs) self._init_conn(**kwargs) self._check_conn_error() @@ -130,6 +135,9 @@ cdef class TaosConnection: raise ConnectionError(errstr, errno) def __dealloc__(self): + if self._current_db is not NULL: + free(self._current_db) + self.close() @property @@ -143,6 +151,20 @@ cdef class TaosConnection: return taos_get_server_info(self._raw_conn).decode("utf-8") + @property + def current_db(self) -> Optional[str]: + if self._raw_conn is NULL: + return + + memset(self._current_db, 0, DB_MAX_LEN * sizeof(char)) + cdef int required + errno = taos_get_current_db(self._raw_conn, self._current_db, DB_MAX_LEN * sizeof(char), &required) + if errno != 0: + errstr = taos_errstr(NULL).decode("utf-8") + raise ProgrammingError(errstr, errno) + + return self._current_db.decode("utf-8") + def validate_sql(self, str sql) -> bool: _sql = sql.encode("utf-8") errno = taos_validate_sql(self._raw_conn, _sql) @@ -282,50 +304,52 @@ cdef class TaosConnection: if _lines is NULL: raise MemoryError() - for i in range(num_of_lines): - _line = lines[i].encode("utf-8") - _lines[i] = _line - - if ttl is None: - if req_id is None: - res = taos_schemaless_insert( - self._raw_conn, - _lines, - num_of_lines, - protocol, - precision, - ) - else: - res = taos_schemaless_insert_with_reqid( - self._raw_conn, - _lines, - num_of_lines, - protocol, - precision, - req_id, - ) - else: - if req_id is None: - res = taos_schemaless_insert_ttl( - self._raw_conn, - _lines, - num_of_lines, - protocol, - precision, - ttl, - ) + try: + for i in range(num_of_lines): + _line = lines[i].encode("utf-8") + _lines[i] = _line + + if ttl is None: + if req_id is None: + res = taos_schemaless_insert( + self._raw_conn, + _lines, + num_of_lines, + protocol, + precision, + ) + else: + res = taos_schemaless_insert_with_reqid( + self._raw_conn, + _lines, + num_of_lines, + protocol, + precision, + req_id, + ) else: - res = taos_schemaless_insert_ttl_with_reqid( - self._raw_conn, - _lines, - num_of_lines, - protocol, - precision, - ttl, - req_id, - ) + if req_id is None: + res = taos_schemaless_insert_ttl( + self._raw_conn, + _lines, + num_of_lines, + protocol, + precision, + ttl, + ) + else: + res = taos_schemaless_insert_ttl_with_reqid( + self._raw_conn, + _lines, + num_of_lines, + protocol, + precision, + ttl, + req_id, + ) + finally: + free(_lines) - free(_lines) errno = taos_errno(res) affected_rows = taos_affected_rows(res) if errno != 0: @@ -1026,6 +1050,19 @@ cdef void async_commit_future_wrapper(tmq_t *tmq, int32_t code, void *param) nog fut.get_loop().call_soon_threadsafe(fut.set_result, code) +cdef void tmq_auto_commit_wrapper(tmq_t *tmq, int32_t code, void *param) nogil: + with gil: + consumer = param + if code == 0: + if consumer.callback is not None: + consumer.callback(consumer) # TODO: param is consumer itself only, seem pretty weird + else: + errstr = tmq_err2str(code).decode("utf-8") + tmq_err = TmqError(errstr, code) + if consumer.error_callback is not None: + consumer.error_callback(tmq_err) + + cdef class TopicPartition: cdef str _topic cdef int32_t _partition @@ -1052,6 +1089,10 @@ cdef class TopicPartition: def offset(self) -> int: return self._offset + @offset.setter + def offset(self, int64_t value): + self._offset = value + @property def begin(self) -> int: return self._begin @@ -1119,11 +1160,13 @@ cdef class Message: cdef TAOS_RES *_res cdef int _err_no cdef char *_err_str + cdef object _dt_epoch def __cinit__(self, size_t res): self._res = res self._err_no = taos_errno(self._res) self._err_str = taos_errstr(self._res) + self._dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch def error(self) -> Optional[TmqError]: """ @@ -1180,7 +1223,6 @@ cdef class Message: table = "" if _table is NULL else _table.decode("utf-8") block = [None] * field_count - dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch cdef int i for i in range(field_count): data = pblock[i] @@ -1195,7 +1237,7 @@ cdef class Message: free(is_null) elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - block[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + block[i] = _parse_timestamp(data, num_of_rows, is_null, precision, self._dt_epoch) free(is_null) else: pass @@ -1232,6 +1274,8 @@ cdef class Message: cdef class TaosConsumer: + cdef object __cb + cdef object __err_cb cdef dict _configs cdef tmq_conf_t *_tmq_conf cdef tmq_t *_tmq @@ -1254,6 +1298,8 @@ cdef class TaosConsumer: } def __cinit__(self, dict configs): + self.__cb = None + self.__err_cb = None self._init_config(configs) self._init_consumer() self._subscribed = False @@ -1279,6 +1325,10 @@ cdef class TaosConsumer: def _init_consumer(self): if self._tmq_conf is NULL: raise TmqError('tmq_conf is NULL') + + if self._configs.get("enable.auto.commit", "false") == "true": + param = self + tmq_conf_set_auto_commit_cb(self._tmq_conf, tmq_auto_commit_wrapper, param) self._tmq = tmq_consumer_new(self._tmq_conf, NULL, 0) if self._tmq is NULL: @@ -1288,6 +1338,24 @@ cdef class TaosConsumer: if tmq_errno != 0: tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") raise TmqError(tmq_errstr, tmq_errno) + + @property + def callback(self): + return self.__cb + + @callback.setter + def callback(self, cb): + assert callable(cb) + self.__cb = cb + + @property + def error_callback(self): + return self.__err_cb + + @error_callback.setter + def error_callback(self, err_cb): + assert callable(err_cb) + self.__err_cb = err_cb def subscribe(self, topics: List[str]): """ @@ -1298,19 +1366,20 @@ cdef class TaosConsumer: if tmq_list is NULL: raise TmqError("new tmq list failed!") - for tp in topics: - _tp = tp.encode("utf-8") - tmq_errno = tmq_list_append(tmq_list, _tp) + try: + for tp in topics: + _tp = tp.encode("utf-8") + tmq_errno = tmq_list_append(tmq_list, _tp) + if tmq_errno != 0: + tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") + raise TmqError(tmq_errstr, tmq_errno) + + tmq_errno = tmq_subscribe(self._tmq, tmq_list) if tmq_errno != 0: tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") - tmq_list_destroy(tmq_list) raise TmqError(tmq_errstr, tmq_errno) - - tmq_errno = tmq_subscribe(self._tmq, tmq_list) - if tmq_errno != 0: - tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") + finally: tmq_list_destroy(tmq_list) - raise TmqError(tmq_errstr, tmq_errno) self._subscribed = True @@ -1353,6 +1422,16 @@ cdef class TaosConsumer: return Message(res) + def set_auto_commit_cb(self, callback: Callable[[TaosConsumer]]=None, error_callback: Callable[[TmqError]]=None): + """ + Set callback for auto commit. + + :param callback: a Callable[[TaosConsumer]] object which was called when message is committed + :param error_callback: a Callable[[TmqError]] object which waw called when something wrong(code != 0) + """ + self.callback = callback + self.error_callback = error_callback + def commit(self, message: Message=None, offsets: List[TopicPartition]=None): """ Commit a message. @@ -1445,20 +1524,21 @@ cdef class TaosConsumer: topics = self.list_topics() topic_partitions = [] - for topic in topics: - _topic = topic.encode("utf-8") - tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &p_assignment, &num_of_assignment) - if tmq_errno != 0: - tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") + try: + for topic in topics: + _topic = topic.encode("utf-8") + tmq_errno = tmq_get_topic_assignment(self._tmq, _topic, &p_assignment, &num_of_assignment) + if tmq_errno != 0: + tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") + raise TmqError(tmq_errstr, tmq_errno) + + for i in range(num_of_assignment): + assignment = p_assignment[i] + tp = TopicPartition(topic, assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) + topic_partitions.append(tp) + finally: + if p_assignment is not NULL: tmq_free_assignment(p_assignment) - raise TmqError(tmq_errstr, tmq_errno) - - for i in range(num_of_assignment): - assignment = p_assignment[i] - tp = TopicPartition(topic, assignment.vgId, assignment.currentOffset, assignment.begin, assignment.end) - topic_partitions.append(tp) - - tmq_free_assignment(p_assignment) return topic_partitions @@ -1486,7 +1566,7 @@ cdef class TaosConsumer: tmq_errno = offset = tmq_committed(self._tmq, _tp, partition._partition) self._check_tmq_error(tmq_errno) - partition._offset = offset + partition.offset = offset return partitions @@ -1506,7 +1586,7 @@ cdef class TaosConsumer: tmq_errno = offset = tmq_position(self._tmq, _tp, partition._partition) self._check_tmq_error(tmq_errno) - partition._offset = offset + partition.offset = offset return partitions @@ -1521,17 +1601,18 @@ cdef class TaosConsumer: if tmq_list is NULL: raise TmqError("new tmq list failed!") - tmq_errno = tmq_subscription(self._tmq, &tmq_list) - self._check_tmq_error(tmq_errno) - - ca = tmq_list_to_c_array(tmq_list) - n = tmq_list_get_size(tmq_list) + try: + tmq_errno = tmq_subscription(self._tmq, &tmq_list) + self._check_tmq_error(tmq_errno) - tp_list = [] - for i in range(n): - tp_list.append(ca[i].decode("utf-8")) + ca = tmq_list_to_c_array(tmq_list) + n = tmq_list_get_size(tmq_list) - tmq_list_destroy(tmq_list) + tp_list = [] + for i in range(n): + tp_list.append(ca[i].decode("utf-8")) + finally: + tmq_list_destroy(tmq_list) return tp_list From 8abfdfc6fcfc4b6ffed3dd1decdf3776ee7e01db Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Tue, 12 Sep 2023 15:15:11 +0800 Subject: [PATCH 25/31] perf: using cython 1.add example and test --- .gitignore | 3 +- examples/cython/bind-multi.py | 46 ++ .../connection_usage_native_reference.py | 45 ++ ...tion_usage_native_reference_with_req_id.py | 45 ++ examples/cython/cursor_execute_many.py | 91 +++ examples/cython/demo.py | 24 + examples/cython/import-json.py | 34 + examples/cython/insert-lines.py | 25 + examples/cython/json-tag.py | 19 + examples/cython/pep-249.py | 11 + examples/cython/query-async.py | 43 ++ examples/cython/query-objectively.py | 14 + examples/cython/result_set_examples.py | 33 + .../cython/result_set_with_req_id_examples.py | 33 + examples/cython/schemaless_insert.py | 565 ++++++++++++++++ examples/cython/tmq_assignment.py | 67 ++ examples/cython/tmq_consumer.py | 46 ++ pyproject.toml | 1 + taos/_objects.pyx | 16 +- taos/error.py | 5 + taos/result.py | 9 - tests/test_taos_cython/test_connect_args.py | 14 + tests/test_taos_cython/test_info.py | 19 + tests/test_taos_cython/test_lines.py | 628 ++++++++++++++++++ tests/test_taos_cython/test_native_cursor.py | 52 ++ tests/test_taos_cython/test_native_many.py | 87 +++ tests/test_taos_cython/test_query.py | 87 +++ tests/test_taos_cython/test_query_a.py | 63 ++ 28 files changed, 2112 insertions(+), 13 deletions(-) create mode 100644 examples/cython/bind-multi.py create mode 100644 examples/cython/connection_usage_native_reference.py create mode 100644 examples/cython/connection_usage_native_reference_with_req_id.py create mode 100644 examples/cython/cursor_execute_many.py create mode 100644 examples/cython/demo.py create mode 100644 examples/cython/import-json.py create mode 100644 examples/cython/insert-lines.py create mode 100644 examples/cython/json-tag.py create mode 100644 examples/cython/pep-249.py create mode 100644 examples/cython/query-async.py create mode 100644 examples/cython/query-objectively.py create mode 100644 examples/cython/result_set_examples.py create mode 100644 examples/cython/result_set_with_req_id_examples.py create mode 100644 examples/cython/schemaless_insert.py create mode 100644 examples/cython/tmq_assignment.py create mode 100644 examples/cython/tmq_consumer.py create mode 100644 tests/test_taos_cython/test_connect_args.py create mode 100644 tests/test_taos_cython/test_info.py create mode 100644 tests/test_taos_cython/test_lines.py create mode 100644 tests/test_taos_cython/test_native_cursor.py create mode 100644 tests/test_taos_cython/test_native_many.py create mode 100644 tests/test_taos_cython/test_query.py create mode 100644 tests/test_taos_cython/test_query_a.py diff --git a/.gitignore b/.gitignore index 99b57319..27b76e0f 100644 --- a/.gitignore +++ b/.gitignore @@ -160,4 +160,5 @@ docs *~ .env taos/*.c -taos/*.cpp \ No newline at end of file +taos/*.cpp +poetry.lock diff --git a/examples/cython/bind-multi.py b/examples/cython/bind-multi.py new file mode 100644 index 00000000..9f6e823c --- /dev/null +++ b/examples/cython/bind-multi.py @@ -0,0 +1,46 @@ +from taos._objects import TaosConnection, TaosMultiBinds + +conn = TaosConnection(host="localhost") +dbname = "pytest_taos_stmt_multi" +conn.execute("drop database if exists %s" % dbname) +conn.execute("create database if not exists %s" % dbname) +conn.select_db(dbname) + +conn.execute( + "create table if not exists log(ts timestamp, bo bool, nil tinyint, \ + ti tinyint, si smallint, ii int, bi bigint, tu tinyint unsigned, \ + su smallint unsigned, iu int unsigned, bu bigint unsigned, \ + ff float, dd double, bb binary(100), nn nchar(100), tt timestamp)", +) + +stmt = conn.statement("insert into log values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)") + + +params = TaosMultiBinds(16) +params[0].timestamp((1626861392589, 1626861392590, 1626861392591)) +params[1].bool((True, None, False)) +params[2].tinyint([-128, -128, None]) # -128 is tinyint null +params[3].tinyint([0, 127, None]) +params[4].smallint([3, None, 2]) +params[5].int([3, 4, None]) +params[6].bigint([3, 4, None]) +params[7].tinyint_unsigned([3, 4, None]) +params[8].smallint_unsigned([3, 4, None]) +params[9].int_unsigned([3, 4, None]) +params[10].bigint_unsigned([3, 4, None]) +params[11].float([3, None, 1]) +params[12].double([3, None, 1.2]) +params[13].binary(["abc", "dddafadfadfadfadfa", None]) +params[14].nchar(["涛思数据", None, "a long string with 中文字符"]) +params[15].timestamp([None, None, 1626861392591]) +stmt.bind_param_batch(params) +stmt.execute() + +assert stmt.affected_rows == 3 + +result = conn.query("select * from log") +for row in result: + print(row) + +conn.execute("drop database if exists %s" % dbname) +conn.close() \ No newline at end of file diff --git a/examples/cython/connection_usage_native_reference.py b/examples/cython/connection_usage_native_reference.py new file mode 100644 index 00000000..c6e41487 --- /dev/null +++ b/examples/cython/connection_usage_native_reference.py @@ -0,0 +1,45 @@ +from taos._objects import TaosConnection + +# ANCHOR: insert +conn = TaosConnection(host="localhost") +# Execute a sql, ignore the result set, just get affected rows. It's useful for DDL and DML statement. +conn.execute("DROP DATABASE IF EXISTS test") +conn.execute("CREATE DATABASE test") +# change database. same as execute "USE db" +conn.select_db("test") +conn.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (location INT)") +affected_row = conn.execute("INSERT INTO t1 USING weather TAGS(1) VALUES (now, 23.5) (now+1m, 23.5) (now+2m, 24.4)") +print("affected_row", affected_row) +# output: +# affected_row 3 +# ANCHOR_END: insert + +# ANCHOR: query +# Execute a sql and get its result set. It's useful for SELECT statement +result = conn.query("SELECT * from weather") + +# Get fields from result +fields = result.fields +for field in fields: + print(field) # {name: ts, type: 9, bytes: 8} + +# output: +# {name: ts, type: 9, bytes: 8} +# {name: temperature, type: 6, bytes: 4} +# {name: location, type: 4, bytes: 4} + +# Get data from result as list of tuple +data = result.fetch_all() +print(data) +# output: +# [(datetime.datetime(2022, 4, 27, 9, 4, 25, 367000), 23.5, 1), (datetime.datetime(2022, 4, 27, 9, 5, 25, 367000), 23.5, 1), (datetime.datetime(2022, 4, 27, 9, 6, 25, 367000), 24.399999618530273, 1)] + +# Or get data from result as a list of dict +# map_data = result.fetch_all_into_dict() +# print(map_data) +# output: +# [{'ts': datetime.datetime(2022, 4, 27, 9, 1, 15, 343000), 'temperature': 23.5, 'location': 1}, {'ts': datetime.datetime(2022, 4, 27, 9, 2, 15, 343000), 'temperature': 23.5, 'location': 1}, {'ts': datetime.datetime(2022, 4, 27, 9, 3, 15, 343000), 'temperature': 24.399999618530273, 'location': 1}] +# ANCHOR_END: query + +conn.execute("DROP DATABASE IF EXISTS test") +conn.close() \ No newline at end of file diff --git a/examples/cython/connection_usage_native_reference_with_req_id.py b/examples/cython/connection_usage_native_reference_with_req_id.py new file mode 100644 index 00000000..938b3d70 --- /dev/null +++ b/examples/cython/connection_usage_native_reference_with_req_id.py @@ -0,0 +1,45 @@ +from taos._objects import TaosConnection + +# ANCHOR: insert +conn = TaosConnection(host="localhost") +# Execute a sql, ignore the result set, just get affected rows. It's useful for DDL and DML statement. +conn.execute("DROP DATABASE IF EXISTS test", req_id=1) +conn.execute("CREATE DATABASE test", req_id=2) +# change database. same as execute "USE db" +conn.select_db("test") +conn.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (location INT)", req_id=3) +affected_row = conn.execute("INSERT INTO t1 USING weather TAGS(1) VALUES (now, 23.5) (now+1m, 23.5) (now+2m, 24.4)", req_id=4) +print("affected_row", affected_row) +# output: +# affected_row 3 +# ANCHOR_END: insert + +# ANCHOR: query +# Execute a sql and get its result set. It's useful for SELECT statement +result = conn.query("SELECT * from weather", req_id=5) + +# Get fields from result +fields = result.fields +for field in fields: + print(field) # {name: ts, type: 9, bytes: 8} + +# output: +# {name: ts, type: 9, bytes: 8} +# {name: temperature, type: 6, bytes: 4} +# {name: location, type: 4, bytes: 4} + +# Get data from result as list of tuple +data = result.fetch_all() +print(data) +# output: +# [(datetime.datetime(2022, 4, 27, 9, 4, 25, 367000), 23.5, 1), (datetime.datetime(2022, 4, 27, 9, 5, 25, 367000), 23.5, 1), (datetime.datetime(2022, 4, 27, 9, 6, 25, 367000), 24.399999618530273, 1)] + +# Or get data from result as a list of dict +# map_data = result.fetch_all_into_dict() +# print(map_data) +# output: +# [{'ts': datetime.datetime(2022, 4, 27, 9, 1, 15, 343000), 'temperature': 23.5, 'location': 1}, {'ts': datetime.datetime(2022, 4, 27, 9, 2, 15, 343000), 'temperature': 23.5, 'location': 1}, {'ts': datetime.datetime(2022, 4, 27, 9, 3, 15, 343000), 'temperature': 24.399999618530273, 'location': 1}] +# ANCHOR_END: query + +conn.execute("DROP DATABASE IF EXISTS test") +conn.close() \ No newline at end of file diff --git a/examples/cython/cursor_execute_many.py b/examples/cython/cursor_execute_many.py new file mode 100644 index 00000000..3883b934 --- /dev/null +++ b/examples/cython/cursor_execute_many.py @@ -0,0 +1,91 @@ +from taos._objects import TaosConnection + +env = { + 'user': "root", + 'password': "taosdata", + 'host': "localhost", + 'port': 6030, +} + + +def make_context(config): + db_protocol = config.get('db_protocol', 'taos') + db_user = config['user'] + db_pass = config['password'] + db_host = config['host'] + db_port = config['port'] + + db_url = f"{db_protocol}://{db_user}:{db_pass}@{db_host}:{db_port}" + print('dsn: ', db_url) + + conn = TaosConnection(**config) + + db_name = config.get('database', 'c_cursor') + + return conn, db_name + + +def test_cursor(): + conn, db_name = make_context(env) + + cur = conn.cursor() + + cur.execute(f"DROP DATABASE IF EXISTS {db_name}") + cur.execute(f"CREATE DATABASE {db_name}") + cur.execute(f"USE {db_name}") + + cur.execute("create stable stb (ts timestamp, v1 int) tags(t1 int)") + + create_table_data = [ + { + "name": "tb1", + "t1": 1, + }, + { + "name": "tb2", + "t1": 2, + }, + { + "name": "tb3", + "t1": 3, + } + ] + + res = cur.executemany( + "create table {name} using stb tags({t1})", + create_table_data, + ) + print(f"affected_rows: {res}") + assert res == 0 + + data = [ + ('2018-10-03 14:38:05.100', 219), + ('2018-10-03 14:38:15.300', 218), + ('2018-10-03 14:38:16.800', 221), + ] + + for table in create_table_data: + table_name = table['name'] + + res = cur.executemany( + f"insert into {table_name} values", + data, + ) + print(f"affected_rows: {res}") + assert res == 3 + + cur.execute('select * from stb') + + data = cur.fetchall() + column_names = [meta[0] for meta in cur.description] + print(column_names) + for r in data: + print(r) + + cur.execute(f"DROP DATABASE IF EXISTS {db_name}") + cur.close() + conn.close() + + +if __name__ == "__main__": + test_cursor() \ No newline at end of file diff --git a/examples/cython/demo.py b/examples/cython/demo.py new file mode 100644 index 00000000..7606f018 --- /dev/null +++ b/examples/cython/demo.py @@ -0,0 +1,24 @@ +from taos._objects import TaosConnection + +conn = TaosConnection(host="localhost") +cursor = conn.cursor() + +sql = "drop database if exists db" +cursor.execute(sql) +sql = "create database if not exists db" +cursor.execute(sql) +sql = "create table db.tb(ts timestamp, n int, bin binary(10), nc nchar(10))" +cursor.execute(sql) +sql = "insert into db.tb values (1650000000000, 1, 'abc', '北京')" +cursor.execute(sql) +sql = "insert into db.tb values (1650000000001, null, null, null)" +cursor.execute(sql) +sql = "select * from db.tb" +cursor.execute(sql) + +for row in cursor: + print(row) + +sql = "drop database if exists db" +cursor.execute(sql) +conn.close() diff --git a/examples/cython/import-json.py b/examples/cython/import-json.py new file mode 100644 index 00000000..9c83f951 --- /dev/null +++ b/examples/cython/import-json.py @@ -0,0 +1,34 @@ +import json +from taos._objects import TaosConnection +import requests + +j = requests.get("http://api.coindesk.com/v1/bpi/currentprice.json").json() + +# json to sql +ts = j["time"]["updatedISO"] +sql = "insert into" +for id in j["bpi"]: + bpi = j["bpi"][id] + sql += ' %s using price tags("%s","%s","%s") values("%s", %lf) ' % ( + id, + bpi["code"], + bpi["symbol"], + bpi["description"], + ts, + bpi["rate_float"], + ) + +# sql to TDengine +conn = TaosConnection(host="localhost") +conn.execute("drop database if exists bpi") +conn.execute("create database if not exists bpi") +conn.execute("use bpi") +conn.execute( + "create stable if not exists price (ts timestamp, rate double)" + + " tags (code binary(10), symbol binary(10), description binary(100))" +) +conn.execute(sql) +result = conn.query("select * from bpi.price") +print(result.fetch_all()) +conn.execute("drop database if exists bpi") +conn.close() \ No newline at end of file diff --git a/examples/cython/insert-lines.py b/examples/cython/insert-lines.py new file mode 100644 index 00000000..cbb7f096 --- /dev/null +++ b/examples/cython/insert-lines.py @@ -0,0 +1,25 @@ +from taos._objects import TaosConnection +from taos._constants import SmlProtocol, SmlPrecision + +conn = TaosConnection(host="localhost") +dbname = "pytest_line" +conn.execute("drop database if exists %s" % dbname) +conn.execute("create database if not exists %s precision 'us'" % dbname) +conn.select_db(dbname) + +lines = [ + 'st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"pass",c2=false,c4=4f64 1626006833639000000', +] +conn.schemaless_insert(lines, SmlProtocol.LINE_PROTOCOL, SmlPrecision.NOT_CONFIGURED) +print("inserted") + +conn.schemaless_insert(lines, SmlProtocol.LINE_PROTOCOL, SmlPrecision.NOT_CONFIGURED) + +tb = conn.query("show tables").fetch_all()[0][0] +print(tb) +result = conn.query("select * from %s" % tb) +for row in result: + print(row) + +conn.execute("drop database if exists %s" % dbname) +conn.close() diff --git a/examples/cython/json-tag.py b/examples/cython/json-tag.py new file mode 100644 index 00000000..69358d2c --- /dev/null +++ b/examples/cython/json-tag.py @@ -0,0 +1,19 @@ +# encoding:UTF-8 +from taos._objects import TaosConnection + +conn = TaosConnection(host="localhost") +conn.execute("drop database if exists py_test_json_type") +conn.execute("create database if not exists py_test_json_type") +conn.execute("use py_test_json_type") + +conn.execute("create stable s1 (ts timestamp, v1 int) tags (info json)") +conn.execute("create table s1_1 using s1 tags ('{\"k1\": \"v1\"}')") +tags = conn.query("select info, tbname from s1").fetch_all_into_dict() +print(tags) + +k1 = conn.query("select info->'k1' as k1 from s1").fetch_all_into_dict() +print(k1) + +conn.execute("drop database py_test_json_type") + +conn.close() diff --git a/examples/cython/pep-249.py b/examples/cython/pep-249.py new file mode 100644 index 00000000..754a5e46 --- /dev/null +++ b/examples/cython/pep-249.py @@ -0,0 +1,11 @@ +from taos._objects import TaosConnection + +conn = TaosConnection(host="localhost") +cursor = conn.cursor() + +cursor.execute("show databases") +results = cursor.fetchall() +for row in results: + print(row) + +conn.close() diff --git a/examples/cython/query-async.py b/examples/cython/query-async.py new file mode 100644 index 00000000..4c2515fd --- /dev/null +++ b/examples/cython/query-async.py @@ -0,0 +1,43 @@ +import asyncio +import time +from taos._objects import TaosConnection + + +def print_all(fut: asyncio.Future): + result = fut.result() + print("result:", result) + print("fields:", result.fields) + # print("data:", result.fetch_all()) # NOT USE fetch_all directly right here + +def callback_print_row(conn, cb=None): + query_task = asyncio.create_task(conn.query_a("select * from power.meters")) + if cb: + query_task.add_done_callback(cb) + + return query_task + +async def test_query(conn): + conn.execute('create database if not exists power') + conn.execute( + 'CREATE STABLE if not exists power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) ' + 'TAGS (location BINARY(64), groupId INT)') + + # async iter row + result = await conn.query_a("select * from power.meters") + print("result:", result) + async for row in result: + print("row:", row) + + + # callback and async fetch all data + task = callback_print_row(conn, print_all) + res = await task + data = await res.fetch_all_a() + print(data) + + +if __name__ == "__main__": + conn = TaosConnection(host="localhost") + loop = asyncio.get_event_loop() + loop.run_until_complete(test_query(conn)) + conn.close() diff --git a/examples/cython/query-objectively.py b/examples/cython/query-objectively.py new file mode 100644 index 00000000..9e6ad8ca --- /dev/null +++ b/examples/cython/query-objectively.py @@ -0,0 +1,14 @@ +from taos._objects import TaosConnection + +conn = TaosConnection(host="localhost") +conn.execute("drop database if exists pytest") +conn.execute("create database if not exists pytest") + +result = conn.query("show databases") +num_of_fields = result.field_count +for field in result.fields: + print(field) +for row in result: + print(row) +conn.execute("drop database if exists pytest") +conn.close() diff --git a/examples/cython/result_set_examples.py b/examples/cython/result_set_examples.py new file mode 100644 index 00000000..0a788dba --- /dev/null +++ b/examples/cython/result_set_examples.py @@ -0,0 +1,33 @@ +from taos._objects import TaosConnection + +conn = TaosConnection(host="localhost") +conn.execute("DROP DATABASE IF EXISTS test") +conn.execute("CREATE DATABASE test") +conn.select_db("test") +conn.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (location INT)") +# prepare data +for i in range(2000): + location = str(i % 10) + tb = "t" + location + conn.execute(f"INSERT INTO {tb} USING weather TAGS({location}) VALUES (now+{i}a, 23.5) (now+{i + 1}a, 23.5)") + +result = conn.query("SELECT * FROM weather") + +block_index = 0 +blocks = result.blocks_iter() +for rows, length in blocks: + print("block ", block_index, " length", length) + print("first row in this block:", rows[0]) + block_index += 1 + +conn.close() + +# possible output: +# block 0 length 1200 +# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 46000), 23.5, 0) +# block 1 length 1200 +# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 76000), 23.5, 3) +# block 2 length 1200 +# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 99000), 23.5, 6) +# block 3 length 400 +# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 122000), 23.5, 9) diff --git a/examples/cython/result_set_with_req_id_examples.py b/examples/cython/result_set_with_req_id_examples.py new file mode 100644 index 00000000..9d237e4b --- /dev/null +++ b/examples/cython/result_set_with_req_id_examples.py @@ -0,0 +1,33 @@ +from taos._objects import TaosConnection + +conn = TaosConnection(host="localhost") +conn.execute("DROP DATABASE IF EXISTS test", req_id=1) +conn.execute("CREATE DATABASE test", req_id=2) +conn.select_db("test") +conn.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (location INT)", req_id=3) +# prepare data +for i in range(2000): + location = str(i % 10) + tb = "t" + location + conn.execute(f"INSERT INTO {tb} USING weather TAGS({location}) VALUES (now+{i}a, 23.5) (now+{i + 1}a, 23.5)", req_id=4+i) + +result = conn.query("SELECT * FROM weather", req_id=2004) + +block_index = 0 +blocks = result.blocks_iter() +for rows, length in blocks: + print("block ", block_index, " length", length) + print("first row in this block:", rows[0]) + block_index += 1 + +conn.close() + +# possible output: +# block 0 length 1200 +# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 46000), 23.5, 0) +# block 1 length 1200 +# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 76000), 23.5, 3) +# block 2 length 1200 +# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 99000), 23.5, 6) +# block 3 length 400 +# first row in this block: (datetime.datetime(2022, 4, 27, 15, 14, 52, 122000), 23.5, 9) diff --git a/examples/cython/schemaless_insert.py b/examples/cython/schemaless_insert.py new file mode 100644 index 00000000..56d3b6e5 --- /dev/null +++ b/examples/cython/schemaless_insert.py @@ -0,0 +1,565 @@ +import taos +from taos._objects import TaosConnection +from taos import utils +from taos.error import OperationalError, SchemalessError, InterfaceError + + +def schemaless_insert(conn: TaosConnection) -> None: + dbname = "schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = [ + 'st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + 'stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + res = conn.schemaless_insert(lines, 1, 0) + print("affected rows: ", res) + assert (res == 3) + + lines = [ + 'stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + res = conn.schemaless_insert(lines, 1, 0) + print("affected rows: ", res) + assert (res == 1) + result = conn.query("select * from st") + + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = [ + ',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + ] + try: + res = conn.schemaless_insert(lines, 1, 0) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def schemaless_insert_with_req_id(conn: TaosConnection) -> None: + dbname = "taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = [ + 'st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + 'stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, req_id) + print("affected rows: ", res) + assert (res == 3) + + lines = [ + 'stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, req_id) + print("affected rows: ", res) + assert (res == 1) + result = conn.query("select * from st") + + dict2 = result.fetch_all_into_dict() + print(dict2) + result.row_count + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = [ + ',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + ] + try: + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, req_id) + print(res) + # assert(False) + except SchemalessError as e: + print(e) + + req_id = utils.gen_req_id() + result = conn.query("select * from st", req_id) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def schemaless_insert_ttl(conn: TaosConnection) -> None: + dbname = "taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = [ + 'st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + 'stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + ttl = 1000 + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl) + print("affected rows: ", res) + assert (res == 3) + + lines = [ + 'stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + ttl = 1000 + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl) + print("affected rows: ", res) + assert (res == 1) + result = conn.query("select * from st") + + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = [ + ',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + ] + try: + ttl = 1000 + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def schemaless_insert_ttl_with_req_id(conn: TaosConnection) -> None: + dbname = "taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = [ + 'st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + 'stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl, req_id=req_id) + print("affected rows: ", res) + assert (res == 3) + + lines = [ + 'stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl, req_id=req_id) + print("affected rows: ", res) + assert (res == 1) + result = conn.query("select * from st") + + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = [ + ',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + ] + try: + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl, req_id=req_id) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def schemaless_insert_raw(conn: TaosConnection) -> None: + dbname = "taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = '''st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000 + st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000 + stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + + res = conn.schemaless_insert_raw(lines, 1, 0) + print("affected rows: ", res) + assert (res == 3) + + lines = '''stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + res = conn.schemaless_insert_raw(lines, 1, 0) + print("affected rows: ", res) + assert (res == 1) + + result = conn.query("select * from st") + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = ''',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000''' + try: + res = conn.schemaless_insert_raw(lines, 1, 0) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + raise err + except SchemalessError as err: + conn.execute("drop database if exists %s" % dbname) + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def schemaless_insert_raw_with_req_id(conn: TaosConnection) -> None: + dbname = "taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = '''st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000 + st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000 + stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, req_id=req_id) + print("affected rows: ", res) + assert (res == 3) + + lines = '''stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, req_id=req_id) + print("affected rows: ", res) + assert (res == 1) + + result = conn.query("select * from st") + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = ''',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000''' + try: + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, req_id=req_id) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def schemaless_insert_raw_ttl(conn: TaosConnection) -> None: + dbname = "taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = '''st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000 + st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000 + stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + + ttl = 1000 + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl) + print("affected rows: ", res) + assert (res == 3) + + lines = '''stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + ttl = 1000 + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl) + print("affected rows: ", res) + assert (res == 1) + + result = conn.query("select * from st") + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = ''',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000''' + try: + ttl = 1000 + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def schemaless_insert_raw_ttl_with_req_id(conn: TaosConnection) -> None: + dbname = "taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = '''st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000 + st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000 + stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl, req_id=req_id) + print("affected rows: ", res) + assert (res == 3) + + lines = '''stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl, req_id=req_id) + print("affected rows: ", res) + assert (res == 1) + + result = conn.query("select * from st") + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = ''',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000''' + try: + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl, req_id=req_id) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +if __name__ == '__main__': + conn = TaosConnection(host="localhost") + schemaless_insert(conn) + schemaless_insert_with_req_id(conn) + schemaless_insert_raw(conn) + schemaless_insert_raw_with_req_id(conn) + schemaless_insert_raw_ttl(conn) + schemaless_insert_raw_ttl_with_req_id(conn) diff --git a/examples/cython/tmq_assignment.py b/examples/cython/tmq_assignment.py new file mode 100644 index 00000000..50cea07a --- /dev/null +++ b/examples/cython/tmq_assignment.py @@ -0,0 +1,67 @@ +#! +from taos._objects import TaosConnection, TaosConsumer +import taos +from taos.tmq import Consumer +import time + + +def prepare(conn): + conn.execute("drop topic if exists tmq_assignment_demo_topic") + conn.execute("drop database if exists tmq_assignment_demo_db") + conn.execute("create database if not exists tmq_assignment_demo_db wal_retention_period 3600") + conn.select_db("tmq_assignment_demo_db") + conn.execute( + "create table if not exists tmq_assignment_demo_table (ts timestamp, c1 int, c2 float, c3 binary(10)) tags(t1 int)") + conn.execute( + "create topic if not exists tmq_assignment_demo_topic as select ts, c1, c2, c3 from tmq_assignment_demo_table") + conn.execute("insert into d0 using tmq_assignment_demo_table tags (0) values (now-2s, 1, 1.0, 'tmq test')") + conn.execute("insert into d0 using tmq_assignment_demo_table tags (0) values (now-1s, 2, 2.0, 'tmq test')") + conn.execute("insert into d0 using tmq_assignment_demo_table tags (0) values (now, 3, 3.0, 'tmq test')") + +def cleanup(conn): + conn.execute("drop topic if exists tmq_assignment_demo_topic") + +def taos_get_assignment_and_seek_demo(): + consumer = TaosConsumer( + { + "group.id": "0", + # should disable snapshot, + # otherwise it will cause invalid params error + 'td.connect.ip': "localhost", + 'td.connect.user': "root", + 'td.connect.pass': "taosdata", + 'td.connect.port': "6030", + # 'td.connect.db', + "experimental.snapshot.enable": "false", + } + ) + consumer.subscribe(["tmq_assignment_demo_topic"]) + + # get topic assignment + assignments = consumer.assignment() + for assignment in assignments: + print(assignment) + + # poll + consumer.poll(1) + consumer.poll(1) + + # get topic assignment again + after_pool_assignments = consumer.assignment() + for assignment in after_pool_assignments: + print(assignment) + + # seek to the beginning + for assignment in assignments: + consumer.seek(assignment) + + # now the assignment should be the same as before poll + assignments = consumer.assignment() + for assignment in assignments: + print(assignment) + +if __name__ == "__main__": + conn = TaosConnection(host="localhost") + prepare(conn) + taos_get_assignment_and_seek_demo() + cleanup(conn) diff --git a/examples/cython/tmq_consumer.py b/examples/cython/tmq_consumer.py new file mode 100644 index 00000000..a6fcbd48 --- /dev/null +++ b/examples/cython/tmq_consumer.py @@ -0,0 +1,46 @@ +from taos._objects import TaosConnection, TaosConsumer + +def init_tmq_env(db, topic): + conn = TaosConnection(host="localhost") + conn.execute("drop topic if exists {}".format(topic)) + conn.execute("drop database if exists {}".format(db)) + conn.execute("create database if not exists {} WAL_RETENTION_PERIOD 3600000 ".format(db)) + conn.select_db(db) + conn.execute("create stable if not exists stb1 (ts timestamp, c1 int, c2 float, c3 binary(10)) tags(t1 int)") + conn.execute("create table if not exists tb1 using stb1 tags(1)") + conn.execute("create table if not exists tb2 using stb1 tags(2)") + conn.execute("create table if not exists tb3 using stb1 tags(3)") + conn.execute("create topic if not exists {} as select ts, c1, c2, c3 from stb1".format(topic)) + conn.execute("insert into tb1 values (now-2s, 1, 1.0, 'tmq test')") + conn.execute("insert into tb2 values (now-1s, 2, 2.0, 'tmq test')") + conn.execute("insert into tb3 values (now, 3, 3.0, 'tmq test')") + + +if __name__ == '__main__': + # init env + init_tmq_env("tmq_test", "tmq_test_topic") + consumer = TaosConsumer( + { + "group.id": "test", + 'td.connect.ip': "localhost", + "td.connect.user": "root", + "td.connect.pass": "taosdata", + "msg.with.table.name": "true", + "enable.auto.commit": "true", + } + ) + consumer.subscribe(["tmq_test_topic"]) + consumer.set_auto_commit_cb(print, print) + + while True: + res = consumer.poll(10) + if not res: + consumer.close() + break + err = res.error() + if err is not None: + raise err + val = res.value() + + for block in val: + print(block.fetchall()) diff --git a/pyproject.toml b/pyproject.toml index 94df2101..cbbc2f14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ pytest = [ { version = "^4.6", python = ">=2.7,<3.0" }, { version = "^6.2", python = ">=3.7,<4.0" }, ] +pytest-asyncio = { version = "^0.16.0" } mypy = { version = "^0.910", python = "^3.6" } black = [{ version = ">=21.0", python = ">=3.6.2,<4.0" }] sqlalchemy = { version = "^1.4", python = ">=3.6,<4.0" } diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 5ffcf4e4..57e50275 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -36,6 +36,8 @@ cdef _check_malloc(void *ptr): if ptr is NULL: raise MemoryError() + +# ---------------------------------------------- TAOS -------------------------------------------------------------- v cdef void async_result_future_wrapper(void *param, TAOS_RES *res, int code) nogil: with gil: fut = param @@ -1042,8 +1044,10 @@ cdef class TaosCursor: def __del__(self): self.close() +# ---------------------------------------------- TAOS -------------------------------------------------------------- v + -# ---------------------------------------- TMQ --------------------------------------------------------------- v +# ---------------------------------------------- TMQ --------------------------------------------------------------- v cdef void async_commit_future_wrapper(tmq_t *tmq, int32_t code, void *param) nogil: with gil: fut = param @@ -1628,7 +1632,10 @@ cdef class TaosConsumer: self._tmq_conf = NULL self.close() -# ---------------------------------------- statement --------------------------------------------------------------- ^ +# ---------------------------------------------- TMQ --------------------------------------------------------------- ^ + + +# ---------------------------------------- statement --------------------------------------------------------------- v cdef class TaosStmt: cdef TAOS_STMT *_stmt @@ -1727,6 +1734,7 @@ cdef class TaosStmt: def __dealloc__(self): self.close() + cdef class TaosMultiBinds: cdef size_t _size cdef TAOS_MULTI_BIND *_binds @@ -1770,6 +1778,7 @@ cdef class TaosMultiBinds: self._size = 0 + cdef class TaosMultiBind: cdef TAOS_MULTI_BIND *_inner @@ -2050,7 +2059,6 @@ cdef class TaosMultiBind: self._inner.buffer = _buffer self._inner.is_null = _is_null - def binary(self, values): _bytes = [v if v is None else v.encode("utf-8") for v in values] self._inner.buffer_type = FieldType.C_BINARY @@ -2143,3 +2151,5 @@ cdef class TaosMultiBind: self._inner.buffer = _buffer self._inner.is_null = _is_null self._inner.length = _length + +# ---------------------------------------- statement --------------------------------------------------------------- ^ diff --git a/taos/error.py b/taos/error.py index bc57a977..01caeba4 100644 --- a/taos/error.py +++ b/taos/error.py @@ -109,3 +109,8 @@ class TmqError(DatabaseError): """Exception raise in TMQ API""" pass + +class PrecisionError(Exception): + """Python datetime does not support nanoseconds error""" + + pass \ No newline at end of file diff --git a/taos/result.py b/taos/result.py index f7990717..686358ba 100644 --- a/taos/result.py +++ b/taos/result.py @@ -120,15 +120,6 @@ def fetch_all(self): buffer[i].extend(block[i]) return list(map(tuple, zip(*buffer))) - def _fetch_all_using_cython(self): - from taos._cinterface import fetch_all as _fetch_all - from taos.field import _datetime_epoch, _priv_datetime_epoch - dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - if self._result is None: - raise OperationalError("Invalid use of fetchall") - - return _fetch_all(self._result.value, dt_epoch) - def fetch_all_into_dict(self): """Fetch all rows and convert it to dict""" names = [field.name for field in self.fields] diff --git a/tests/test_taos_cython/test_connect_args.py b/tests/test_taos_cython/test_connect_args.py new file mode 100644 index 00000000..860b80a5 --- /dev/null +++ b/tests/test_taos_cython/test_connect_args.py @@ -0,0 +1,14 @@ +from taos._objects import TaosConnection + + +def test_connect_args(): + """ + DO NOT DELETE THIS TEST CASE! + + Useless args, prevent mistakenly deleted args in connect init. + Because some case in CI of earlier version may use it. + """ + host = 'localhost:6030' + conn = TaosConnection(host) + assert conn is not None + conn.close() diff --git a/tests/test_taos_cython/test_info.py b/tests/test_taos_cython/test_info.py new file mode 100644 index 00000000..01bae155 --- /dev/null +++ b/tests/test_taos_cython/test_info.py @@ -0,0 +1,19 @@ +from taos._objects import TaosConnection +import pytest + + +@pytest.fixture +def conn(): + return TaosConnection(host="localhost") + + +def test_client_info(conn): + print("client info: %s" % conn.client_info) + pass + + +def test_server_info(conn): + # type: (TaosConnection) -> None + print("conn client info: %s" % conn.client_info) + print("conn server info: %s" % conn.server_info) + pass diff --git a/tests/test_taos_cython/test_lines.py b/tests/test_taos_cython/test_lines.py new file mode 100644 index 00000000..77fdd55f --- /dev/null +++ b/tests/test_taos_cython/test_lines.py @@ -0,0 +1,628 @@ +from taos.error import OperationalError, SchemalessError, InterfaceError +from taos._objects import TaosConnection +from taos._constants import PrecisionEnum +import taos.utils as utils + +import taos +import pytest + + +@pytest.fixture +def conn(): + # type: () -> taos.TaosConnection + return TaosConnection(host="localhost") + + +def test_schemaless_insert_update_2(conn): + # type: (TaosConnection) -> None + + dbname = "test_schemaless_insert_update_2" + try: + conn.execute("drop database if exists %s" % dbname) + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + conn.select_db(dbname) + + lines = [ + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + ] + res = conn.schemaless_insert(lines, 1, 0) + print("affected rows: ", res) + assert (res == 1) + + result = conn.query("select * from st") + [before] = result.fetch_all_into_dict() + assert (before["c3"] == "passitagin, abc") + + lines = [ + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + ] + res = conn.schemaless_insert(lines, 1, 0) + result = conn.query("select * from st") + [after] = result.fetch_all_into_dict() + assert (after["c3"] == "passitagin") + + conn.execute("drop database if exists %s" % dbname) + conn.close() + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def test_schemaless_insert(conn): + # type: (TaosConnection) -> None + + dbname = "pytest_taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = [ + 'st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + 'stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + res = conn.schemaless_insert(lines, 1, 0) + print("affected rows: ", res) + assert (res == 3) + + lines = [ + 'stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + res = conn.schemaless_insert(lines, 1, 0) + print("affected rows: ", res) + assert (res == 1) + result = conn.query("select * from st") + + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = [ + ',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + ] + try: + res = conn.schemaless_insert(lines, 1, 0) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + conn.close() + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def test_schemaless_insert_ttl(conn: TaosConnection) -> None: + dbname = "pytest_taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = [ + 'st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + 'stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + ttl = 1000 + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl) + print("affected rows: ", res) + assert (res == 3) + + lines = [ + 'stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + ttl = 1000 + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl) + print("affected rows: ", res) + assert (res == 1) + result = conn.query("select * from st") + + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = [ + ',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + ] + try: + ttl = 1000 + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + conn.close() + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def test_schemaless_insert_ttl_with_req_id(conn: TaosConnection) -> None: + dbname = "pytest_taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = [ + 'st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + 'stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl, req_id=req_id) + print("affected rows: ", res) + assert (res == 3) + + lines = [ + 'stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl, req_id=req_id) + print("affected rows: ", res) + assert (res == 1) + result = conn.query("select * from st") + + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = [ + ',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + ] + try: + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, ttl=ttl, req_id=req_id) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + conn.close() + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def test_schemaless_insert_raw(conn: TaosConnection) -> None: + dbname = "pytest_taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = '''st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000 + st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000 + stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + + res = conn.schemaless_insert_raw(lines, 1, 0) + print("affected rows: ", res) + assert (res == 3) + + lines = '''stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + res = conn.schemaless_insert_raw(lines, 1, 0) + print("affected rows: ", res) + assert (res == 1) + + result = conn.query("select * from st") + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = ''',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000''' + try: + res = conn.schemaless_insert_raw(lines, 1, 0) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + conn.close() + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except SchemalessError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def test_schemaless_insert_raw_with_req_id(conn: TaosConnection) -> None: + dbname = "pytest_taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = '''st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000 + st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000 + stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, req_id=req_id) + print("affected rows: ", res) + assert (res == 3) + + lines = '''stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, req_id=req_id) + print("affected rows: ", res) + assert (res == 1) + + result = conn.query("select * from st") + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = ''',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000''' + try: + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, req_id=req_id) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + conn.close() + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def test_schemaless_insert_raw_ttl(conn: TaosConnection) -> None: + dbname = "pytest_taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = '''st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000 + st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000 + stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + + ttl = 1000 + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl) + print("affected rows: ", res) + assert (res == 3) + + lines = '''stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + ttl = 1000 + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl) + print("affected rows: ", res) + assert (res == 1) + + result = conn.query("select * from st") + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = ''',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000''' + try: + ttl = 1000 + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + conn.close() + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def test_schemaless_insert_raw_ttl_with_req_id(conn: TaosConnection) -> None: + dbname = "pytest_taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = '''st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000 + st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000 + stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl, req_id=req_id) + print("affected rows: ", res) + assert (res == 3) + + lines = '''stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000''' + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl, req_id=req_id) + print("affected rows: ", res) + assert (res == 1) + + result = conn.query("select * from st") + dict2 = result.fetch_all_into_dict() + print(dict2) + print(result.row_count) + + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = ''',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000''' + try: + ttl = 1000 + req_id = utils.gen_req_id() + res = conn.schemaless_insert_raw(lines, 1, 0, ttl=ttl, req_id=req_id) + print(res) + # assert(False) + except SchemalessError as err: + print('**** error: ', err) + # assert (err.msg == 'Invalid data format') + + result = conn.query("select * from st") + print(result.row_count) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + conn.close() + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err + + +def test_schemaless_insert_with_req_id(conn): + # type: (TaosConnection) -> None + + dbname = "pytest_taos_schemaless_insert" + try: + conn.execute("drop database if exists %s" % dbname) + if taos.IS_V3: + conn.execute("create database if not exists %s schemaless 1 precision 'ns'" % dbname) + else: + conn.execute("create database if not exists %s update 2 precision 'ns'" % dbname) + + conn.select_db(dbname) + + lines = [ + 'st,t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + 'st,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin, abc",c2=true,c4=5f64,c5=5f64,c6=7u64 1626006933640000000', + 'stf,t1=4i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, req_id) + print("affected rows: ", res) + assert (res == 3) + + lines = [ + 'stf,t1=5i64,t3="t4",t2=5f64,t4=5f64 c1=3i64,c3=L"passitagin_stf",c2=false,c5=5f64,c6=7u64 1626006933641000000', + ] + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, req_id) + print("affected rows: ", res) + assert (res == 1) + result = conn.query("select * from st") + + dict2 = result.fetch_all_into_dict() + print(dict2) + result.row_count + all = result.rows_iter() + for row in all: + print(row) + result.close() + assert (result.row_count == 2) + + # error test + lines = [ + ',t1=3i64,t2=4f64,t3="t3" c1=3i64,c3=L"passit",c2=false,c4=4f64 1626006833639000000', + ] + try: + req_id = utils.gen_req_id() + res = conn.schemaless_insert(lines, 1, 0, req_id) + print(res) + # assert(False) + except SchemalessError as e: + print(e) + + req_id = utils.gen_req_id() + result = conn.query("select * from st", req_id) + all = result.rows_iter() + for row in all: + print(row) + result.close() + + conn.execute("drop database if exists %s" % dbname) + conn.close() + except InterfaceError as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + except Exception as err: + conn.execute("drop database if exists %s" % dbname) + conn.close() + print(err) + raise err diff --git a/tests/test_taos_cython/test_native_cursor.py b/tests/test_taos_cython/test_native_cursor.py new file mode 100644 index 00000000..3e5a109d --- /dev/null +++ b/tests/test_taos_cython/test_native_cursor.py @@ -0,0 +1,52 @@ +from taos._objects import TaosConnection + +env = { + 'user': "root", + 'password': "taosdata", + 'host': "localhost", + 'port': 6030, +} + + +def make_context(config): + db_protocol = config.get('db_protocol', 'taos') + db_user = config['user'] + db_pass = config['password'] + db_host = config['host'] + db_port = config['port'] + + db_url = f"{db_protocol}://{db_user}:{db_pass}@{db_host}:{db_port}" + print('dsn: ', db_url) + + conn = TaosConnection(**config) + + db_name = config.get('database', 'c_cursor') + + return conn, db_name + + +def test_cursor(): + conn, db_name = make_context(env) + + cursor = conn.cursor() + + cursor.execute(f"DROP DATABASE IF EXISTS {db_name}") + cursor.execute(f"CREATE DATABASE {db_name}") + cursor.execute(f"USE {db_name}") + + cursor.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (location INT)") + + cursor.execute(f"INSERT INTO t1 USING weather TAGS(1) VALUES (now, 23.5) (now+100a, 23.5)") + + assert cursor.rowcount == 2 + + cursor.execute("SELECT tbname, ts, temperature, location FROM weather") + # rowcount can only get correct value after fetching all data + all_data = cursor.fetchall() + print(f"{'*' * 20} row count: {cursor.rowcount} {'*' * 20}") + for row in all_data: + print(row) + assert cursor.rowcount == 2 + conn.execute("DROP DATABASE IF EXISTS %s" % db_name) + cursor.close() + conn.close() diff --git a/tests/test_taos_cython/test_native_many.py b/tests/test_taos_cython/test_native_many.py new file mode 100644 index 00000000..80204674 --- /dev/null +++ b/tests/test_taos_cython/test_native_many.py @@ -0,0 +1,87 @@ +from taos._objects import TaosConnection + +env = { + 'user': "root", + 'password': "taosdata", + 'host': "localhost", + 'port': 6030, +} + + +def make_context(config): + db_protocol = config.get('db_protocol', 'taos') + db_user = config['user'] + db_pass = config['password'] + db_host = config['host'] + db_port = config['port'] + + db_url = f"{db_protocol}://{db_user}:{db_pass}@{db_host}:{db_port}" + print('dsn: ', db_url) + + conn = TaosConnection(**config) + + db_name = config.get('database', 'c_cursor') + + return conn, db_name + + +def test_cursor(): + conn, db_name = make_context(env) + + cur = conn.cursor() + + cur.execute(f"DROP DATABASE IF EXISTS {db_name}") + cur.execute(f"CREATE DATABASE {db_name}") + cur.execute(f"USE {db_name}") + + cur.execute("create stable stb (ts timestamp, v1 int) tags(t1 int)") + + create_table_data = [ + { + "name": "tb1", + "t1": 1, + }, + { + "name": "tb2", + "t1": 2, + }, + { + "name": "tb3", + "t1": 3, + } + ] + + res = cur.executemany( + "create table {name} using stb tags({t1})", + create_table_data, + ) + print(f"r: {res}") + assert res == 0 + + data = [ + ('2018-10-03 14:38:05.100', 219), + ('2018-10-03 14:38:15.300', 218), + ('2018-10-03 14:38:16.800', 221), + ] + + for table in create_table_data: + table_name = table['name'] + + res = cur.executemany( + f"insert into {table_name} values", + data, + ) + print(f"r: {res}") + assert res == 3 + + res = cur.execute('select * from stb') + print(f'res: {res}') + data = cur.fetchall() + column_names = [meta[0] for meta in cur.description] + print(column_names) + for r in data: + print(r) + + conn.execute("DROP DATABASE IF EXISTS %s" % db_name) + cur.close() + conn.close() diff --git a/tests/test_taos_cython/test_query.py b/tests/test_taos_cython/test_query.py new file mode 100644 index 00000000..255872c8 --- /dev/null +++ b/tests/test_taos_cython/test_query.py @@ -0,0 +1,87 @@ +from datetime import datetime +from taos import utils +from taos.error import InterfaceError +from taos._objects import TaosConnection +import taos +import pytest + +@pytest.fixture +def conn(): + return TaosConnection(host="localhost") + +def test_query(conn): + conn.execute("drop database if exists test_query_py") + conn.execute("create database if not exists test_query_py") + conn.execute("use test_query_py") + conn.execute("create table if not exists tb1 (ts timestamp, v int) tags(jt json)") + n = conn.execute("insert into tn1 using tb1 tags('{\"name\":\"value\"}') values(now, null) (now + 10s, 1)") + n = conn.execute("insert into tn1 using tb1 tags('{\"name\":\"value\"}') values(now, null) (now + 10s, 1)") + print("inserted %d rows" % n) + result = conn.query("select * from tb1") + fields = result.fields + for field in fields: + print("field: %s" % field) + + # test re-consume fields + flag = 0 + for _ in fields: + flag += 1 + assert flag == 3 + + start = datetime.now() + for row in result: + print(row) + None + + for row in result.rows_iter(): + print(row) + + result = conn.query("select * from tb1 limit 1") + results = result.fetch_all_into_dict() + print(results) + + end = datetime.now() + elapsed = end - start + print("elapsed time: ", elapsed) + result.close() + conn.execute("drop database if exists test_query_py") + conn.close() + + +def test_query_with_req_id(conn): + conn.execute("drop database if exists test_query_py") + conn.execute("create database if not exists test_query_py") + conn.execute("use test_query_py") + conn.execute("create table if not exists tb1 (ts timestamp, v int) tags(jt json)") + n = conn.execute("insert into tn1 using tb1 tags('{\"name\":\"value\"}') values(now, null) (now + 10s, 1)") + n = conn.execute("insert into tn1 using tb1 tags('{\"name\":\"value\"}') values(now, null) (now + 10s, 1)") + print("inserted %d rows" % n) + result = conn.query("select * from tb1") + fields = result.fields + for field in fields: + print("field: %s" % field) + + # test re-consume fields + flag = 0 + for _ in fields: + flag += 1 + assert flag == 3 + + start = datetime.now() + for row in result: + print(row) + None + + for row in result.rows_iter(): + print(row) + + result = conn.query("select * from tb1 limit 1", req_id=utils.gen_req_id()) + results = result.fetch_all_into_dict() + print(results) + + end = datetime.now() + elapsed = end - start + print("elapsed time: ", elapsed) + result.close() + conn.execute("drop database if exists test_query_py") + conn.close() diff --git a/tests/test_taos_cython/test_query_a.py b/tests/test_taos_cython/test_query_a.py new file mode 100644 index 00000000..bcf38596 --- /dev/null +++ b/tests/test_taos_cython/test_query_a.py @@ -0,0 +1,63 @@ +import asyncio +import time +from taos._objects import TaosConnection +from taos import utils +import pytest + +pytest_plugins = ('pytest_asyncio',) + + +@pytest.fixture +def conn(): + return TaosConnection(host="localhost") + +def print_all(fut: asyncio.Future): + result = fut.result() + print("result:", result) + print("fields:", result.fields) + # print("data:", result.fetch_all()) # NOT USE fetch_all directly right here + +@pytest.mark.asyncio +async def test_query_a(conn): + conn.execute("drop database if exists pytestquerya") + conn.execute("create database pytestquerya") + conn.execute("use pytestquerya") + cols = ["bool", "tinyint", "smallint", "int", "bigint", "tinyint unsigned", "smallint unsigned", "int unsigned", + "bigint unsigned", "float", "double", "binary(100)", "nchar(100)"] + s = ','.join("c%d %s" % (i, t) for i, t in enumerate(cols)) + print(s) + conn.execute("create table tb1(ts timestamp, %s)" % s) + for _ in range(100): + s = ','.join('null' for c in cols) + conn.execute("insert into tb1 values(now, %s)" % s) + + # async query, async iter row + result = await conn.query_a("select * from tb1") + print("result:", result) + async for row in result: + print("row:", row) + + # async query, add callback, async fetch all data + query_task = asyncio.create_task(conn.query_a("select * from tb1")) + query_task.add_done_callback(print_all) + res = await query_task + data = await res.fetch_all_a() + print(data) + + # async query with req_id, async iter row + result = await conn.query_a("select * from tb1", req_id=utils.gen_req_id()) + print("result:", result) + async for row in result: + print("row:", row) + + + # async query with req_id, add callback, async fetch all data + query_task = asyncio.create_task(conn.query_a("select * from tb1", req_id=utils.gen_req_id())) + query_task.add_done_callback(print_all) + res = await query_task + data = await res.fetch_all_a() + print(data) + + conn.execute("drop database if exists pytestquerya") + conn.close() + From add9a1a10bb5dd2ba293e047908b98cb4b54e65d Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Tue, 12 Sep 2023 19:11:21 +0800 Subject: [PATCH 26/31] perf: using cython 1. add _parse_bytes 2. separate timestamp parsing and datetime convert --- taos/_cinterface.pyx | 20 +++++++++--------- taos/_constants.pyx | 1 + taos/_objects.pyx | 50 +++++++++++++++++++------------------------- taos/_parser.pxd | 8 +++++-- taos/_parser.pyx | 33 +++++++++++++++++++++++++---- 5 files changed, 68 insertions(+), 44 deletions(-) diff --git a/taos/_cinterface.pyx b/taos/_cinterface.pyx index 5699d65f..265e37e8 100644 --- a/taos/_cinterface.pyx +++ b/taos/_cinterface.pyx @@ -7,7 +7,7 @@ import pytz from collections import namedtuple from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError from taos._parser cimport (_parse_bool, _parse_int8_t, _parse_int16_t, _parse_int, _parse_int64_t, _parse_float, _parse_double, _parse_timestamp, - _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string) + _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string, _parse_bytes, _parse_datetime) cdef bool *taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): is_null = malloc(rows * sizeof(bool)) @@ -28,11 +28,11 @@ SIZED_TYPE = { TSDB_DATA_TYPE_BIGINT, TSDB_DATA_TYPE_FLOAT, TSDB_DATA_TYPE_DOUBLE, - TSDB_DATA_TYPE_VARCHAR, TSDB_DATA_TYPE_UTINYINT, TSDB_DATA_TYPE_USMALLINT, TSDB_DATA_TYPE_UINT, TSDB_DATA_TYPE_UBIGINT, + TSDB_DATA_TYPE_TIMESTAMP, } UNSIZED_TYPE = { @@ -59,7 +59,7 @@ CONVERT_FUNC = { TSDB_DATA_TYPE_UINT: _parse_uint, TSDB_DATA_TYPE_UBIGINT: _parse_uint64_t, TSDB_DATA_TYPE_JSON: _parse_string, - TSDB_DATA_TYPE_VARBINARY: _parse_string, + TSDB_DATA_TYPE_VARBINARY: _parse_bytes, TSDB_DATA_TYPE_DECIMAL: None, TSDB_DATA_TYPE_BLOB: None, TSDB_DATA_TYPE_MEDIUMBLOB: None, @@ -82,17 +82,17 @@ cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_ data = pblock[i] field = fields[i] - if field.type in UNSIZED_TYPE: - offsets = taos_get_column_data_offset(res, i) - blocks[i] = _parse_string(data, num_of_rows, offsets) - elif field.type in SIZED_TYPE: + if field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): is_null = taos_get_column_data_is_null(res, i, num_of_rows) - blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + blocks[i] = _parse_datetime(data, num_of_rows, is_null, precision, dt_epoch) free(is_null) - elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): + elif field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(res, i, num_of_rows) - blocks[i] = _parse_timestamp(data, num_of_rows, is_null, precision, dt_epoch) + blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) free(is_null) + elif field.type in UNSIZED_TYPE: + offsets = taos_get_column_data_offset(res, i) + blocks[i] = _parse_string(data, num_of_rows, offsets) else: pass diff --git a/taos/_constants.pyx b/taos/_constants.pyx index ece201e4..56435f6a 100644 --- a/taos/_constants.pyx +++ b/taos/_constants.pyx @@ -60,6 +60,7 @@ class FieldType: C_INT_UNSIGNED = 13 C_BIGINT_UNSIGNED = 14 C_JSON = 15 + C_VARBINARY = 16 # NULL value definition # NOTE: These values should change according to C definition in tsdb.h C_BOOL_NULL = 0x02 diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 57e50275..a1e08b3d 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -2,16 +2,13 @@ from libc.stdlib cimport malloc, free from libc.string cimport memset, strcpy, memcpy -import ctypes import asyncio import datetime as dt import pytz -import inspect -from collections import namedtuple from typing import Optional, List, Tuple, Dict, Iterator, AsyncIterator, Callable from taos._cinterface cimport * -from taos._parser cimport _parse_string, _parse_timestamp, _parse_binary_string, _parse_nchar_string, _parse_raw_timestamp from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC +from taos._parser cimport _convert_timestamp_to_datetime from taos._constants import TaosOption, SmlPrecision, SmlProtocol, TmqResultType, PrecisionEnum from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError, TmqError, SchemalessError from taos.constants import FieldType @@ -624,21 +621,19 @@ cdef class TaosResult: data = pblock[i] field = self._fields[i] - if field.type in UNSIZED_TYPE: - offsets = taos_get_column_data_offset(self._res, i) - blocks[i] = _parse_string(data, num_of_rows, offsets) - elif field.type in SIZED_TYPE: + if field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) - free(is_null) - elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - blocks[i] = _parse_timestamp(data, num_of_rows, is_null, self._precision, self._dt_epoch) - free(is_null) - # blocks[i] = _parse_raw_timestamp(data, num_of_rows, is_null) + free(is_null) + elif field.type in UNSIZED_TYPE: + offsets = taos_get_column_data_offset(self._res, i) + blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, offsets) else: pass + if field.type == TSDB_DATA_TYPE_TIMESTAMP and self._precision in (PrecisionEnum.Milliseconds, PrecisionEnum.Microseconds): + blocks[i] = _convert_timestamp_to_datetime(blocks[i], self._precision, self._dt_epoch) + self._row_count += num_of_rows return blocks, abs(num_of_rows) @@ -656,16 +651,16 @@ cdef class TaosResult: for i in range(self._field_count): data = taos_row[i] field = self._fields[i] - if field.type in UNSIZED_TYPE: - row[i] = _parse_string(data, 1, offsets)[0] if data is not NULL else None # FIXME: is it ok to set offsets = [-2] here - elif field.type in SIZED_TYPE: + if field.type in SIZED_TYPE: row[i] = CONVERT_FUNC[field.type](data, 1, is_null)[0] if data is not NULL else None - elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - row[i] = _parse_timestamp(data, 1, is_null, self._precision, self._dt_epoch)[0] if data is not NULL else None - # row[i] = _parse_raw_timestamp(data, 1, is_null)[0] + elif field.type in UNSIZED_TYPE: + row[i] = CONVERT_FUNC[field.type](data, 1, offsets)[0] if data is not NULL else None # FIXME: is it ok to set offsets = [-2] here else: pass + if field.type == TSDB_DATA_TYPE_TIMESTAMP and self._precision in (PrecisionEnum.Milliseconds, PrecisionEnum.Microseconds): + row[i] = _convert_timestamp_to_datetime([row[i]], self._precision, self._dt_epoch)[0] + self._row_count += 1 return tuple(row) # TODO: list -> tuple, too much object is create here @@ -1232,20 +1227,19 @@ cdef class Message: data = pblock[i] field = _fields[i] - if field.type in UNSIZED_TYPE: - offsets = taos_get_column_data_offset(self._res, i) - block[i] = _parse_string(data, num_of_rows, offsets) - elif field.type in SIZED_TYPE: + if field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) block[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) free(is_null) - elif field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - block[i] = _parse_timestamp(data, num_of_rows, is_null, precision, self._dt_epoch) - free(is_null) + elif field.type in UNSIZED_TYPE: + offsets = taos_get_column_data_offset(self._res, i) + block[i] = CONVERT_FUNC[field.type](data, num_of_rows, offsets) else: pass + if field.type == TSDB_DATA_TYPE_TIMESTAMP and precision in (PrecisionEnum.Milliseconds, PrecisionEnum.Microseconds): + block[i] = _convert_timestamp_to_datetime(block[i], precision, self._dt_epoch) + return MessageBlock(block, fields, num_of_rows, field_count, table) def value(self) -> List[MessageBlock]: diff --git a/taos/_parser.pxd b/taos/_parser.pxd index 4bd07b78..6aee8b03 100644 --- a/taos/_parser.pxd +++ b/taos/_parser.pxd @@ -5,6 +5,8 @@ cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length) cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length) +cdef list _parse_bytes(size_t ptr, int num_of_rows, size_t offsets) + cdef list _parse_string(size_t ptr, int num_of_rows, size_t offsets) cdef list _parse_bool(size_t ptr, int num_of_rows, size_t is_null) @@ -33,6 +35,8 @@ cdef list _parse_float(size_t ptr, int num_of_rows, size_t is_null) cdef list _parse_double(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_timestamp(size_t ptr, int num_of_rows, size_t is_null, int precision, object dt_epoch) +cdef list _parse_datetime(size_t ptr, int num_of_rows, size_t is_null, int precision, object dt_epoch) + +cdef list _parse_timestamp(size_t ptr, int num_of_rows, size_t is_null) -cdef list _parse_raw_timestamp(size_t ptr, int num_of_rows, size_t is_null) \ No newline at end of file +cdef list _convert_timestamp_to_datetime(list ts, int precision, object dt_epoch) \ No newline at end of file diff --git a/taos/_parser.pyx b/taos/_parser.pyx index b294452b..5cdd0d91 100644 --- a/taos/_parser.pyx +++ b/taos/_parser.pyx @@ -22,6 +22,24 @@ cdef list _parse_nchar_string(size_t ptr, int num_of_rows, int field_length): return res +cdef list _parse_bytes(size_t ptr, int num_of_rows, size_t offsets): + cdef list res = [] + cdef int i + cdef size_t rbyte_ptr + cdef size_t c_char_ptr + cdef int *_offset = offsets + for i in range(abs(num_of_rows)): + if _offset[i] == -1: + res.append(None) + else: + rbyte_ptr = ptr + _offset[i] + rbyte = (rbyte_ptr)[0] + c_char_ptr = rbyte_ptr + sizeof(uint16_t) + py_bytes = (c_char_ptr)[:rbyte] + res.append(py_bytes) + + return res + cdef list _parse_string(size_t ptr, int num_of_rows, size_t offsets): cdef list res = [] cdef int i @@ -209,7 +227,7 @@ cdef list _parse_double(size_t ptr, int num_of_rows, size_t is_null): return res -cdef list _parse_timestamp(size_t ptr, int num_of_rows, size_t is_null, int precision, object dt_epoch): +cdef list _parse_datetime(size_t ptr, int num_of_rows, size_t is_null, int precision, object dt_epoch): cdef list res = [] cdef int i cdef bool *_is_null = is_null @@ -227,8 +245,7 @@ cdef list _parse_timestamp(size_t ptr, int num_of_rows, size_t is_null, int prec res.append(_dt) return res - -cdef list _parse_raw_timestamp(size_t ptr, int num_of_rows, size_t is_null): +cdef list _parse_timestamp(size_t ptr, int num_of_rows, size_t is_null): cdef list res = [] cdef int i cdef bool *_is_null = is_null @@ -239,4 +256,12 @@ cdef list _parse_raw_timestamp(size_t ptr, int num_of_rows, size_t is_null): else: raw_value = v_ptr[i] res.append(raw_value) - return res \ No newline at end of file + return res + +cdef list _convert_timestamp_to_datetime(list ts, int precision, object dt_epoch): + cdef double denom = 10**((precision + 1) * 3) + for i, t in enumerate(ts): + if t is not None: + ts[i] = dt_epoch + dt.timedelta(seconds=t / denom) + + return ts \ No newline at end of file From 1c1a75eb717797d75b68ba208460e03d8bdf3353 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Wed, 13 Sep 2023 15:11:34 +0800 Subject: [PATCH 27/31] perf: using cython 1.connection and consumer would have independent timezone and dt epoch --- examples/cython/bind-multi.py | 6 +- examples/cython/query-async.py | 6 +- examples/cython/result_set_examples.py | 2 +- examples/cython/tmq_consumer.py | 3 +- taos/_cinterface.pyx | 12 +-- taos/_objects.pyx | 127 ++++++++++++++++--------- 6 files changed, 98 insertions(+), 58 deletions(-) diff --git a/examples/cython/bind-multi.py b/examples/cython/bind-multi.py index 9f6e823c..7a320ce4 100644 --- a/examples/cython/bind-multi.py +++ b/examples/cython/bind-multi.py @@ -1,6 +1,8 @@ from taos._objects import TaosConnection, TaosMultiBinds +import datetime as dt +import pytz -conn = TaosConnection(host="localhost") +conn = TaosConnection(host="localhost", timezone="Asia/Shanghai") dbname = "pytest_taos_stmt_multi" conn.execute("drop database if exists %s" % dbname) conn.execute("create database if not exists %s" % dbname) @@ -32,7 +34,7 @@ params[12].double([3, None, 1.2]) params[13].binary(["abc", "dddafadfadfadfadfa", None]) params[14].nchar(["涛思数据", None, "a long string with 中文字符"]) -params[15].timestamp([None, None, 1626861392591]) +params[15].timestamp([dt.datetime.now(tz=pytz.timezone("Asia/Shanghai")), dt.datetime.now(tz=pytz.timezone("UTC")), dt.datetime.now()]) stmt.bind_param_batch(params) stmt.execute() diff --git a/examples/cython/query-async.py b/examples/cython/query-async.py index 4c2515fd..33da0644 100644 --- a/examples/cython/query-async.py +++ b/examples/cython/query-async.py @@ -10,7 +10,7 @@ def print_all(fut: asyncio.Future): # print("data:", result.fetch_all()) # NOT USE fetch_all directly right here def callback_print_row(conn, cb=None): - query_task = asyncio.create_task(conn.query_a("select * from power.meters")) + query_task = asyncio.create_task(conn.query_a("select * from test.meters")) if cb: query_task.add_done_callback(cb) @@ -19,11 +19,11 @@ def callback_print_row(conn, cb=None): async def test_query(conn): conn.execute('create database if not exists power') conn.execute( - 'CREATE STABLE if not exists power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) ' + 'CREATE STABLE if not exists test.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) ' 'TAGS (location BINARY(64), groupId INT)') # async iter row - result = await conn.query_a("select * from power.meters") + result = await conn.query_a("select * from power.meters limit 1000") print("result:", result) async for row in result: print("row:", row) diff --git a/examples/cython/result_set_examples.py b/examples/cython/result_set_examples.py index 0a788dba..6bd9ad18 100644 --- a/examples/cython/result_set_examples.py +++ b/examples/cython/result_set_examples.py @@ -1,6 +1,6 @@ from taos._objects import TaosConnection -conn = TaosConnection(host="localhost") +conn = TaosConnection(host="localhost", timezone="Asia/Shanghai") conn.execute("DROP DATABASE IF EXISTS test") conn.execute("CREATE DATABASE test") conn.select_db("test") diff --git a/examples/cython/tmq_consumer.py b/examples/cython/tmq_consumer.py index a6fcbd48..531ac681 100644 --- a/examples/cython/tmq_consumer.py +++ b/examples/cython/tmq_consumer.py @@ -27,7 +27,8 @@ def init_tmq_env(db, topic): "td.connect.pass": "taosdata", "msg.with.table.name": "true", "enable.auto.commit": "true", - } + }, + timezone="Asia/Shanghai" ) consumer.subscribe(["tmq_test_topic"]) consumer.set_auto_commit_cb(print, print) diff --git a/taos/_cinterface.pyx b/taos/_cinterface.pyx index 265e37e8..97af7e34 100644 --- a/taos/_cinterface.pyx +++ b/taos/_cinterface.pyx @@ -7,7 +7,8 @@ import pytz from collections import namedtuple from taos.error import ProgrammingError, OperationalError, ConnectionError, DatabaseError, StatementError, InternalError from taos._parser cimport (_parse_bool, _parse_int8_t, _parse_int16_t, _parse_int, _parse_int64_t, _parse_float, _parse_double, _parse_timestamp, - _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string, _parse_bytes, _parse_datetime) + _parse_uint8_t, _parse_uint16_t, _parse_uint, _parse_uint64_t, _parse_string, _parse_bytes, _parse_datetime, _convert_timestamp_to_datetime) +from taos._constants import PrecisionEnum cdef bool *taos_get_column_data_is_null(TAOS_RES *res, int field, int rows): is_null = malloc(rows * sizeof(bool)) @@ -82,11 +83,7 @@ cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_ data = pblock[i] field = fields[i] - if field.type in (TSDB_DATA_TYPE_TIMESTAMP, ): - is_null = taos_get_column_data_is_null(res, i, num_of_rows) - blocks[i] = _parse_datetime(data, num_of_rows, is_null, precision, dt_epoch) - free(is_null) - elif field.type in SIZED_TYPE: + if field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(res, i, num_of_rows) blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) free(is_null) @@ -96,6 +93,9 @@ cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_ else: pass + if field.type == TSDB_DATA_TYPE_TIMESTAMP and precision in (PrecisionEnum.Milliseconds, PrecisionEnum.Microseconds): + blocks[i] = _convert_timestamp_to_datetime(blocks[i], precision, dt_epoch) + return blocks, abs(num_of_rows) cpdef fetch_all(size_t ptr, dt_epoch): diff --git a/taos/_objects.pyx b/taos/_objects.pyx index a1e08b3d..47714a27 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -5,7 +5,7 @@ from libc.string cimport memset, strcpy, memcpy import asyncio import datetime as dt import pytz -from typing import Optional, List, Tuple, Dict, Iterator, AsyncIterator, Callable +from typing import Optional, List, Tuple, Dict, Iterator, AsyncIterator, Callable, Union from taos._cinterface cimport * from taos._cinterface import SIZED_TYPE, UNSIZED_TYPE, CONVERT_FUNC from taos._parser cimport _convert_timestamp_to_datetime @@ -14,21 +14,10 @@ from taos.error import ProgrammingError, OperationalError, ConnectionError, Data from taos.constants import FieldType DB_MAX_LEN = 64 -_priv_tz = None -_utc_tz = pytz.timezone("UTC") -try: - _datetime_epoch = dt.datetime.fromtimestamp(0) -except OSError: - _datetime_epoch = dt.datetime.fromtimestamp(86400) - dt.timedelta(seconds=86400) -_utc_datetime_epoch = _utc_tz.localize(dt.datetime.utcfromtimestamp(0)) -_priv_datetime_epoch = None +DEFAULT_TZ = None +DEFAULT_DT_EPOCH = dt.datetime.fromtimestamp(0, tz=DEFAULT_TZ) -def set_tz(tz): - global _priv_tz, _priv_datetime_epoch - _priv_tz = tz - _priv_datetime_epoch = _utc_datetime_epoch.astimezone(_priv_tz) - cdef _check_malloc(void *ptr): if ptr is NULL: raise MemoryError() @@ -43,7 +32,7 @@ cdef void async_result_future_wrapper(void *param, TAOS_RES *res, int code) nogi e = ProgrammingError(errstr, code) fut.get_loop().call_soon_threadsafe(fut.set_exception, e) else: - taos_result = TaosResult(res, is_async=True) + taos_result = TaosResult(res) fut.get_loop().call_soon_threadsafe(fut.set_result, taos_result) @@ -81,13 +70,17 @@ cdef class TaosConnection: cdef char *_password cdef char *_database cdef uint16_t _port - cdef char *_tz + # cdef char *_raw_tz # can not name as _timezone cdef char *_config cdef TAOS *_raw_conn cdef char *_current_db + cdef object _tz + cdef object _dt_epoch def __cinit__(self, *args, **kwargs): self._current_db = malloc(DB_MAX_LEN * sizeof(char)) + self._tz = DEFAULT_TZ + self._dt_epoch = DEFAULT_DT_EPOCH _check_malloc(self._current_db) self._init_options(**kwargs) self._init_conn(**kwargs) @@ -95,10 +88,9 @@ cdef class TaosConnection: def _init_options(self, **kwargs): if "timezone" in kwargs: - _tz = kwargs["timezone"].encode("utf-8") - self._tz = _tz - set_tz(pytz.timezone(kwargs["timezone"])) - taos_options(TaosOption.Timezone, self._tz) + _timezone = kwargs["timezone"].encode("utf-8") + taos_options(TaosOption.Timezone, _timezone) + self.tz = kwargs["timezone"] if "config" in kwargs: _config = kwargs["config"].encode("utf-8") @@ -150,6 +142,20 @@ cdef class TaosConnection: return taos_get_server_info(self._raw_conn).decode("utf-8") + @property + def tz(self) -> Optional[dt.tzinfo]: + return self._tz + + @tz.setter + def tz(self, timezone: Optional[Union[str, dt.tzinfo]]): + if isinstance(timezone, str): + timezone = pytz.timezone(timezone) + + assert timezone is None or isinstance(timezone, dt.tzinfo) + + self._tz = timezone + self._dt_epoch = dt.datetime.fromtimestamp(0, tz=self._tz) + @property def current_db(self) -> Optional[str]: if self._raw_conn is NULL: @@ -191,7 +197,9 @@ cdef class TaosConnection: taos_free_result(res) raise ProgrammingError(errstr, errno) - return TaosResult(res) + taos_res = TaosResult(res) + taos_res._set_dt_epoch(self._dt_epoch) + return taos_res async def query_a(self, str sql, req_id: Optional[int] = None) -> TaosResult: loop = asyncio.get_event_loop() @@ -202,8 +210,10 @@ cdef class TaosConnection: else: taos_query_a_with_reqid(self._raw_conn, _sql, async_result_future_wrapper, fut, req_id) - res = await fut - return res + taos_res = await fut + taos_res._set_dt_epoch(self._dt_epoch) + taos_res._mark_async() + return taos_res def statement(self, sql: Optional[str]=None) -> Optional[TaosStmt]: if self._raw_conn is NULL: @@ -554,7 +564,7 @@ cdef class TaosResult: cdef object _dt_epoch cdef bool _is_async - def __cinit__(self, size_t res, bool is_async=False): + def __cinit__(self, size_t res): self._res = res self._check_result_error() self._field_count = taos_field_count(self._res) @@ -563,8 +573,8 @@ cdef class TaosResult: self._precision = taos_result_precision(self._res) self._affected_rows = taos_affected_rows(self._res) self._row_count = self._affected_rows if self._field_count == 0 else 0 - self._dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - self._is_async = is_async + self._dt_epoch = DEFAULT_DT_EPOCH + self._is_async = False def __str__(self): return "TaosResult(field_count=%d, precision=%d, affected_rows=%d, row_count=%d)" % (self._field_count, self._precision, self._affected_rows, self._row_count) @@ -603,6 +613,12 @@ cdef class TaosResult: """the row_count of the object""" return self._row_count + def _set_dt_epoch(self, dt_epoch): + self._dt_epoch = dt_epoch + + def _mark_async(self): + self._is_async = True + def _check_result_error(self): errno = taos_errno(self._res) if errno != 0: @@ -1165,7 +1181,7 @@ cdef class Message: self._res = res self._err_no = taos_errno(self._res) self._err_str = taos_errstr(self._res) - self._dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch + self._dt_epoch = DEFAULT_DT_EPOCH def error(self) -> Optional[TmqError]: """ @@ -1206,6 +1222,9 @@ cdef class Message: :rtype: int """ return tmq_get_vgroup_offset(self._res) + + def _set_dt_epoch(self, dt_epoch): + self._dt_epoch = dt_epoch def _fetch_message_block(self) -> MessageBlock: cdef TAOS_ROW pblock @@ -1278,6 +1297,8 @@ cdef class TaosConsumer: cdef tmq_conf_t *_tmq_conf cdef tmq_t *_tmq cdef bool _subscribed + cdef object _tz + cdef object _dt_epoch default_config = { 'group.id', 'client.id', @@ -1295,12 +1316,16 @@ cdef class TaosConsumer: 'td.connect.db', } - def __cinit__(self, dict configs): + def __cinit__(self, dict configs, **kwargs): self.__cb = None self.__err_cb = None self._init_config(configs) self._init_consumer() self._subscribed = False + self._tz = DEFAULT_TZ + self._dt_epoch = DEFAULT_DT_EPOCH + if "timezone" in kwargs: + self.tz = kwargs["timezone"] def _init_config(self, dict configs): if 'group.id' not in configs: @@ -1337,6 +1362,20 @@ cdef class TaosConsumer: tmq_errstr = tmq_err2str(tmq_errno).decode("utf-8") raise TmqError(tmq_errstr, tmq_errno) + @property + def tz(self) -> Optional[dt.tzinfo]: + return self._tz + + @tz.setter + def tz(self, timezone: Optional[Union[str, dt.tzinfo]]): + if isinstance(timezone, str): + timezone = pytz.timezone(timezone) + + assert timezone is None or isinstance(timezone, dt.tzinfo) + + self._tz = timezone + self._dt_epoch = dt.datetime.fromtimestamp(0, tz=self._tz) + @property def callback(self): return self.__cb @@ -1418,7 +1457,9 @@ cdef class TaosConsumer: if res is NULL: return None - return Message(res) + msg = Message(res) + msg._set_dt_epoch(self._dt_epoch) + return msg def set_auto_commit_cb(self, callback: Callable[[TaosConsumer]]=None, error_callback: Callable[[TmqError]]=None): """ @@ -2018,7 +2059,7 @@ cdef class TaosMultiBind: self._inner.buffer = _buffer self._inner.is_null = _is_null - def timestamp(self, values, precision=PrecisionEnum.Milliseconds): + def timestamp(self, values, precision=PrecisionEnum.Milliseconds): # BUG: program just crash if one of the values is None in the first timestamp column self._inner.buffer_type = FieldType.C_TIMESTAMP self._inner.buffer_length = sizeof(int64_t) self._inner.num = len(values) @@ -2027,29 +2068,25 @@ cdef class TaosMultiBind: _is_null = malloc(self._inner.num * sizeof(char)) _check_malloc(_is_null) - dt_epoch = _priv_datetime_epoch if _priv_datetime_epoch else _datetime_epoch - - if len(values) > 0: - if isinstance(values[0], dt.datetime): - values = [int(round((v - dt_epoch).total_seconds() * 10**(3*(precision+1)))) for v in values] - elif isinstance(values[0], str): - for i, v in enumerate(values): - v = dt.datetime.fromisoformat(v) - values[i] = int(round((v - dt_epoch).total_seconds() * 10**(3*(precision+1)))) - elif isinstance(values[0], float): - values = [int(round(v * 10**(3*(precision+1)))) for v in values] - else: - pass - + m = 10**(3*(precision+1)) for i in range(self._inner.num): v = values[i] if v is None: _buffer[i] = FieldType.C_BIGINT_NULL _is_null[i] = 1 else: + if isinstance(v, dt.datetime): + v = int(round(v.timestamp() * m)) + elif isinstance(v, str): + v = int(round(dt.datetime.fromisoformat(v).timestamp() * m)) + elif isinstance(v, float): + v = int(round(v * m)) + else: + pass + _buffer[i] = v _is_null[i] = 0 - + self._inner.buffer = _buffer self._inner.is_null = _is_null From 49bbc534d32ae2e63b81d500755f212d008d3d1d Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Wed, 13 Sep 2023 18:21:10 +0800 Subject: [PATCH 28/31] perf: using cython 1.compile as c only --- build.py | 4 ++-- taos/_cinterface.pxd | 3 ++- taos/_parser.pxd | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build.py b/build.py index c61d1b4f..00c2af00 100644 --- a/build.py +++ b/build.py @@ -21,7 +21,7 @@ def build(setup_kwargs): Extension("taos._cinterface", ["taos/_cinterface.pyx"], libraries=["taos"], ), - Extension("taos._parser", ["taos/_parser.pyx"], language="c++"), + Extension("taos._parser", ["taos/_parser.pyx"]), Extension("taos._objects", ["taos/_objects.pyx"], libraries=["taos"], ), @@ -36,7 +36,7 @@ def build(setup_kwargs): include_dirs=[r"C:\TDengine\include"], library_dirs=[r"C:\TDengine\driver"], ), - Extension("taos._parser", ["taos/_parser.pyx"], language="c++"), + Extension("taos._parser", ["taos/_parser.pyx"]), Extension("taos._objects", ["taos/_objects.pyx"], libraries=["taos"], include_dirs=[r"C:\TDengine\include"], diff --git a/taos/_cinterface.pxd b/taos/_cinterface.pxd index 384b5cb6..39fe166f 100644 --- a/taos/_cinterface.pxd +++ b/taos/_cinterface.pxd @@ -1,5 +1,6 @@ from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t -from libcpp cimport bool + +ctypedef bint bool cdef extern from "taos.h": ctypedef void TAOS diff --git a/taos/_parser.pxd b/taos/_parser.pxd index 6aee8b03..54921561 100644 --- a/taos/_parser.pxd +++ b/taos/_parser.pxd @@ -1,5 +1,6 @@ from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t -from libcpp cimport bool + +ctypedef bint bool cdef list _parse_binary_string(size_t ptr, int num_of_rows, int field_length) From 96e8c4cf93ff0147a40146eb1b09e105fd89ed01 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Thu, 14 Sep 2023 09:26:38 +0800 Subject: [PATCH 29/31] perf: using cython 1.fix taos_fetch_block_v3 --- taos/_cinterface.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taos/_cinterface.pyx b/taos/_cinterface.pyx index 97af7e34..56b26078 100644 --- a/taos/_cinterface.pyx +++ b/taos/_cinterface.pyx @@ -89,7 +89,7 @@ cdef taos_fetch_block_v3(TAOS_RES *res, TAOS_FIELD *fields, int field_count, dt_ free(is_null) elif field.type in UNSIZED_TYPE: offsets = taos_get_column_data_offset(res, i) - blocks[i] = _parse_string(data, num_of_rows, offsets) + blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, offsets) else: pass From e18ee6adb1ddffded0440d0eefd21fb89df3c0db Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Fri, 15 Sep 2023 16:25:29 +0800 Subject: [PATCH 30/31] perf: using cython 1. fix `TaosConsumer.commit_a` 2. remove useless `no gil` 3. fix typo 4. fix some type hints --- taos/_objects.pyx | 131 ++++++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 62 deletions(-) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index 47714a27..f6247a35 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -24,44 +24,41 @@ cdef _check_malloc(void *ptr): # ---------------------------------------------- TAOS -------------------------------------------------------------- v -cdef void async_result_future_wrapper(void *param, TAOS_RES *res, int code) nogil: - with gil: - fut = param - if code != 0: - errstr = taos_errstr(res).decode("utf-8") - e = ProgrammingError(errstr, code) - fut.get_loop().call_soon_threadsafe(fut.set_exception, e) - else: - taos_result = TaosResult(res) - fut.get_loop().call_soon_threadsafe(fut.set_result, taos_result) - - -cdef void async_rows_future_wrapper(void *param, TAOS_RES *res, int num_of_rows) nogil: +cdef void async_result_future_wrapper(void *param, TAOS_RES *res, int code) with gil: + fut = param + if code != 0: + errstr = taos_errstr(res).decode("utf-8") + e = ProgrammingError(errstr, code) + fut.get_loop().call_soon_threadsafe(fut.set_exception, e) + else: + taos_result = TaosResult(res) + fut.get_loop().call_soon_threadsafe(fut.set_result, taos_result) + + +cdef void async_rows_future_wrapper(void *param, TAOS_RES *res, int num_of_rows) with gil: cdef int i = 0 - with gil: - taos_result, fut = param - rows = [] - if num_of_rows > 0: - while True: - row = taos_result._fetch_row() - rows.append(row) - i += 1 - if i >= num_of_rows: - break + taos_result, fut = param + rows = [] + if num_of_rows > 0: + while True: + row = taos_result._fetch_row() + rows.append(row) + i += 1 + if i >= num_of_rows: + break - fut.get_loop().call_soon_threadsafe(fut.set_result, rows) + fut.get_loop().call_soon_threadsafe(fut.set_result, rows) -cdef void async_block_future_wrapper(void *param, TAOS_RES *res, int num_of_rows) nogil: +cdef void async_block_future_wrapper(void *param, TAOS_RES *res, int num_of_rows) with gil: cdef int i = 0 - with gil: - taos_result, fut = param - if num_of_rows > 0: - block, n = taos_result._fetch_block() - else: - block, n = [], 0 + taos_result, fut = param + if num_of_rows > 0: + block, n = taos_result._fetch_block() + else: + block, n = [], 0 - fut.get_loop().call_soon_threadsafe(fut.set_result, (block, n)) + fut.get_loop().call_soon_threadsafe(fut.set_result, (block, n)) cdef class TaosConnection: @@ -631,7 +628,7 @@ cdef class TaosResult: if num_of_rows == 0: return [], 0 - blocks = [None] * self._field_count + block = [None] * self._field_count cdef int i for i in range(self._field_count): data = pblock[i] @@ -639,19 +636,19 @@ cdef class TaosResult: if field.type in SIZED_TYPE: is_null = taos_get_column_data_is_null(self._res, i, num_of_rows) - blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) + block[i] = CONVERT_FUNC[field.type](data, num_of_rows, is_null) free(is_null) elif field.type in UNSIZED_TYPE: offsets = taos_get_column_data_offset(self._res, i) - blocks[i] = CONVERT_FUNC[field.type](data, num_of_rows, offsets) + block[i] = CONVERT_FUNC[field.type](data, num_of_rows, offsets) else: pass if field.type == TSDB_DATA_TYPE_TIMESTAMP and self._precision in (PrecisionEnum.Milliseconds, PrecisionEnum.Microseconds): - blocks[i] = _convert_timestamp_to_datetime(blocks[i], self._precision, self._dt_epoch) + block[i] = _convert_timestamp_to_datetime(block[i], self._precision, self._dt_epoch) self._row_count += num_of_rows - return blocks, abs(num_of_rows) + return block, abs(num_of_rows) def _fetch_row(self) -> Optional[Tuple]: cdef TAOS_ROW taos_row @@ -687,8 +684,8 @@ cdef class TaosResult: taos_fetch_rows_a(self._res, async_block_future_wrapper, param) # taos_fetch_raw_block_a(self._res, async_block_future_wrapper, param) # FIXME: have some problem when parsing nchar - block, n = await fut - return block, n + block, num_of_rows = await fut + return block, num_of_rows async def _fetch_rows_a(self) -> List[Tuple]: loop = asyncio.get_event_loop() @@ -934,9 +931,6 @@ cdef class TaosCursor: for row in block: yield row - def next(self): - return next(self) - @property def description(self) -> List[Tuple]: return self._description @@ -1009,7 +1003,7 @@ cdef class TaosCursor: affected_rows += self.execute(sql, req_id=req_id) return affected_rows - def fetchone(self) -> Optional[List]: + def fetchone(self) -> Optional[Tuple]: try: row = next(self) except StopIteration: @@ -1059,23 +1053,21 @@ cdef class TaosCursor: # ---------------------------------------------- TMQ --------------------------------------------------------------- v -cdef void async_commit_future_wrapper(tmq_t *tmq, int32_t code, void *param) nogil: - with gil: - fut = param - fut.get_loop().call_soon_threadsafe(fut.set_result, code) - - -cdef void tmq_auto_commit_wrapper(tmq_t *tmq, int32_t code, void *param) nogil: - with gil: - consumer = param - if code == 0: - if consumer.callback is not None: - consumer.callback(consumer) # TODO: param is consumer itself only, seem pretty weird - else: - errstr = tmq_err2str(code).decode("utf-8") - tmq_err = TmqError(errstr, code) - if consumer.error_callback is not None: - consumer.error_callback(tmq_err) +cdef void async_commit_future_wrapper(tmq_t *tmq, int32_t code, void *param) with gil: + fut = param + fut.get_loop().call_soon_threadsafe(fut.set_result, code) + + +cdef void tmq_auto_commit_wrapper(tmq_t *tmq, int32_t code, void *param) with gil: + consumer = param + if code == 0: + if consumer.callback is not None: + consumer.callback(consumer) # TODO: param is consumer itself only, seem pretty weird + else: + errstr = tmq_err2str(code).decode("utf-8") + tmq_err = TmqError(errstr, code) + if consumer.error_callback is not None: + consumer.error_callback(tmq_err) cdef class TopicPartition: @@ -1119,6 +1111,9 @@ cdef class TopicPartition: def __str__(self): return "TopicPartition(topic=%s, partition=%s, offset=%s)" % (self.topic, self.partition, self.offset) + def __repr__(self): + return "TopicPartition(topic=%s, partition=%s, offset=%s)" % (self.topic, self.partition, self.offset) + cdef class MessageBlock: cdef list _block @@ -1170,6 +1165,11 @@ cdef class MessageBlock: def __iter__(self) -> Iterator[Tuple]: return zip(*self._block) + def __str__(self): + return "MessageBlock(table=%s, nrows=%s, ncols=%s)" % (self.table, self.nrows, self.ncols) + + def __repr__(self): + return "MessageBlock(table=%s, nrows=%s, ncols=%s)" % (self.table, self.nrows, self.ncols) cdef class Message: cdef TAOS_RES *_res @@ -1183,6 +1183,12 @@ cdef class Message: self._err_str = taos_errstr(self._res) self._dt_epoch = DEFAULT_DT_EPOCH + def __str__(self): + return "Message(topic=%s, database=%s, vgroup=%s, offset=%s)" % (self.topic(), self.database(), self.vgroup(), self.offset()) + + def __repr__(self): + return "Message(topic=%s, database=%s, vgroup=%s, offset=%s)" % (self.topic(), self.database(), self.vgroup(), self.offset()) + def error(self) -> Optional[TmqError]: """ The message object is also used to propagate errors and events, an application must check error() to determine @@ -1226,7 +1232,7 @@ cdef class Message: def _set_dt_epoch(self, dt_epoch): self._dt_epoch = dt_epoch - def _fetch_message_block(self) -> MessageBlock: + def _fetch_message_block(self) -> Optional[MessageBlock]: cdef TAOS_ROW pblock num_of_rows = taos_fetch_block(self._res, &pblock) if num_of_rows == 0: @@ -1511,7 +1517,8 @@ cdef class TaosConsumer: return if offsets: - self.offsets_commit_a(offsets) + await self.offsets_commit_a(offsets) + return loop = asyncio.get_event_loop() fut = loop.create_future() From 3f0c0f5eb3fbd9c44cb2b5f2b1f6c99888300692 Mon Sep 17 00:00:00 2001 From: hadrianl <137150224@qq.com> Date: Mon, 18 Sep 2023 13:57:25 +0800 Subject: [PATCH 31/31] perf: using cython 1.fix potential memory leak(set values more than once) --- taos/_objects.pyx | 268 ++++++++++++++++++++++------------------------ 1 file changed, 126 insertions(+), 142 deletions(-) diff --git a/taos/_objects.pyx b/taos/_objects.pyx index f6247a35..0611593c 100644 --- a/taos/_objects.pyx +++ b/taos/_objects.pyx @@ -1712,14 +1712,14 @@ cdef class TaosStmt: raise StatementError("Invalid use of set_tbname_tags") _name = name.encode("utf-8") - errno = taos_stmt_set_tbname_tags(self._stmt, _name, tags._binds) + errno = taos_stmt_set_tbname_tags(self._stmt, _name, tags._raw_binds) self._check_stmt_error(errno) def bind_param(self, TaosMultiBinds binds, bool add_batch=True): if self._stmt is NULL: raise StatementError("Invalid use of bind_param") - errno = taos_stmt_bind_param(self._stmt, binds._binds) + errno = taos_stmt_bind_param(self._stmt, binds._raw_binds) self._check_stmt_error(errno) if add_batch: @@ -1729,7 +1729,7 @@ cdef class TaosStmt: if self._stmt is NULL: raise StatementError("Invalid use of bind_param_batch") - errno = taos_stmt_bind_param_batch(self._stmt, binds._binds) + errno = taos_stmt_bind_param_batch(self._stmt, binds._raw_binds) self._check_stmt_error(errno) if add_batch: @@ -1779,13 +1779,21 @@ cdef class TaosStmt: cdef class TaosMultiBinds: cdef size_t _size - cdef TAOS_MULTI_BIND *_binds + cdef TAOS_MULTI_BIND *_raw_binds + cdef list _binds def __cinit__(self, size_t size): self._size = size - self._binds = malloc(size * sizeof(TAOS_MULTI_BIND)) - _check_malloc(self._binds) - memset(self._binds, 0, size * sizeof(TAOS_MULTI_BIND)) + self._init_binds(size) + + def _init_binds(self, size_t size): + self._raw_binds = malloc(size * sizeof(TAOS_MULTI_BIND)) + _check_malloc(self._raw_binds) + memset(self._raw_binds, 0, size * sizeof(TAOS_MULTI_BIND)) + self._binds = [] + for i in range(size): + _pbind = self._raw_binds + (i * sizeof(TAOS_MULTI_BIND)) + self._binds.append(TaosMultiBind(_pbind)) def __str__(self): return "TaosMultiBinds(size=%d)" % (self._size, ) @@ -1794,29 +1802,13 @@ cdef class TaosMultiBinds: return "TaosMultiBinds(size=%d)" % (self._size, ) def __getitem__(self, item): - if item >= self._size: - raise IndexError() - - _pbind = self._binds + (item * sizeof(TAOS_MULTI_BIND)) - return TaosMultiBind(_pbind) + return self._binds[item] def __dealloc__(self): - if self._binds is not NULL: - for i in range(self._size): - if self._binds[i].buffer is not NULL: - free(self._binds[i].buffer) - self._binds[i].buffer = NULL - - if self._binds[i].is_null is not NULL: - free(self._binds[i].is_null) - self._binds[i].is_null = NULL - - if self._binds[i].length is not NULL: - free(self._binds[i].length) - self._binds[i].length = NULL - - free(self._binds) - self._binds = NULL + if self._raw_binds is not NULL: + self._binds = [] + free(self._raw_binds) + self._raw_binds = NULL self._size = 0 @@ -1827,6 +1819,46 @@ cdef class TaosMultiBind: def __cinit__(self, size_t pbind): self._inner = pbind + def __dealloc__(self): + if self._inner.buffer is not NULL: + free(self._inner.buffer) + self._inner.buffer = NULL + + if self._inner.is_null is not NULL: + free(self._inner.is_null) + self._inner.is_null = NULL + + if self._inner.length is not NULL: + free(self._inner.length) + self._inner.length = NULL + + cdef _init_buffer(self, size_t size): + if self._inner.buffer is not NULL: + free(self._inner.buffer) + self._inner.buffer = NULL + + _buffer = malloc(size) + _check_malloc(_buffer) + self._inner.buffer = _buffer + + cdef _init_is_null(self, size_t size): + if self._inner.is_null is not NULL: + free(self._inner.is_null) + self._inner.is_null = NULL + + _is_null = malloc(size) + _check_malloc(_is_null) + self._inner.is_null = _is_null + + cdef _init_length(self, size_t size): + if self._inner.length is not NULL: + free(self._inner.length) + self._inner.length = NULL + + _length = malloc(size) + _check_malloc(_length) + self._inner.length = _length + def __str__(self): return "TaosMultiBind(buffer_type=%s, buffer_length=%d, num=%d)" % (self._inner.buffer_type, self._inner.buffer_length, self._inner.num) @@ -1837,10 +1869,10 @@ cdef class TaosMultiBind: self._inner.buffer_type = FieldType.C_BOOL self._inner.buffer_length = sizeof(bool) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(bool)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -1850,18 +1882,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def tinyint(self, values): self._inner.buffer_type = FieldType.C_TINYINT self._inner.buffer_length = sizeof(int8_t) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(int8_t)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -1871,18 +1900,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def smallint(self, values): self._inner.buffer_type = FieldType.C_SMALLINT self._inner.buffer_length = sizeof(int16_t) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(int16_t)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -1892,18 +1918,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def int(self, values): self._inner.buffer_type = FieldType.C_INT self._inner.buffer_length = sizeof(int32_t) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(int32_t)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -1913,18 +1936,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def bigint(self, values): self._inner.buffer_type = FieldType.C_BIGINT self._inner.buffer_length = sizeof(int64_t) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(int64_t)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -1934,18 +1954,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def float(self, values): self._inner.buffer_type = FieldType.C_FLOAT self._inner.buffer_length = sizeof(float) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(float)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -1956,18 +1973,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def double(self, values): self._inner.buffer_type = FieldType.C_DOUBLE self._inner.buffer_length = sizeof(double) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(double)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -1978,18 +1992,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def tinyint_unsigned(self, values): self._inner.buffer_type = FieldType.C_TINYINT_UNSIGNED self._inner.buffer_length = sizeof(uint8_t) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(uint8_t)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -1999,18 +2010,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def smallint_unsigned(self, values): self._inner.buffer_type = FieldType.C_SMALLINT_UNSIGNED self._inner.buffer_length = sizeof(uint16_t) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(uint16_t)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -2020,18 +2028,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def int_unsigned(self, values): self._inner.buffer_type = FieldType.C_INT_UNSIGNED self._inner.buffer_length = sizeof(uint32_t) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(uint32_t)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -2041,18 +2046,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def bigint_unsigned(self, values): self._inner.buffer_type = FieldType.C_BIGINT_UNSIGNED self._inner.buffer_length = sizeof(uint64_t) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(uint64_t)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null for i in range(self._inner.num): v = values[i] @@ -2062,18 +2064,15 @@ cdef class TaosMultiBind: else: _buffer[i] = v _is_null[i] = 0 - - self._inner.buffer = _buffer - self._inner.is_null = _is_null def timestamp(self, values, precision=PrecisionEnum.Milliseconds): # BUG: program just crash if one of the values is None in the first timestamp column self._inner.buffer_type = FieldType.C_TIMESTAMP self._inner.buffer_length = sizeof(int64_t) self._inner.num = len(values) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * sizeof(int64_t)) + self._init_is_null(self._inner.num * sizeof(char)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null m = 10**(3*(precision+1)) for i in range(self._inner.num): @@ -2094,20 +2093,17 @@ cdef class TaosMultiBind: _buffer[i] = v _is_null[i] = 0 - self._inner.buffer = _buffer - self._inner.is_null = _is_null - def binary(self, values): _bytes = [v if v is None else v.encode("utf-8") for v in values] self._inner.buffer_type = FieldType.C_BINARY self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) self._inner.num = len(values) - _length = malloc(self._inner.num * sizeof(int32_t)) - _check_malloc(_length) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * self._inner.buffer_length) + self._init_is_null(self._inner.num * sizeof(char)) + self._init_length(self._inner.num * sizeof(int32_t)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null + _length = self._inner.length _buf = bytearray(self._inner.num * self._inner.buffer_length) for i in range(self._inner.num): @@ -2124,21 +2120,17 @@ cdef class TaosMultiBind: memcpy(_buffer, _buf, self._inner.num * self._inner.buffer_length) - self._inner.buffer = _buffer - self._inner.is_null = _is_null - self._inner.length = _length - def nchar(self, values): _bytes = [v if v is None else v.encode("utf-8") for v in values] self._inner.buffer_type = FieldType.C_NCHAR self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) self._inner.num = len(values) - _length = malloc(self._inner.num * sizeof(int32_t)) - _check_malloc(_length) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * self._inner.buffer_length) + self._init_is_null(self._inner.num * sizeof(char)) + self._init_length(self._inner.num * sizeof(int32_t)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null + _length = self._inner.length _buf = bytearray(self._inner.num * self._inner.buffer_length) for i in range(self._inner.num): @@ -2155,21 +2147,17 @@ cdef class TaosMultiBind: memcpy(_buffer, _buf, self._inner.num * self._inner.buffer_length) - self._inner.buffer = _buffer - self._inner.is_null = _is_null - self._inner.length = _length - def json(self, values): _bytes = [v if v is None else v.encode("utf-8") for v in values] self._inner.buffer_type = FieldType.C_JSON self._inner.buffer_length = max(len(b) for b in _bytes if b is not None) self._inner.num = len(values) - _length = malloc(self._inner.num * sizeof(int32_t)) - _check_malloc(_length) - _buffer = malloc(self._inner.num * self._inner.buffer_length) - _check_malloc(_buffer) - _is_null = malloc(self._inner.num * sizeof(char)) - _check_malloc(_is_null) + self._init_buffer(self._inner.num * self._inner.buffer_length) + self._init_is_null(self._inner.num * sizeof(char)) + self._init_length(self._inner.num * sizeof(int32_t)) + _buffer = self._inner.buffer + _is_null = self._inner.is_null + _length = self._inner.length _buf = bytearray(self._inner.num * self._inner.buffer_length) for i in range(self._inner.num): @@ -2186,8 +2174,4 @@ cdef class TaosMultiBind: memcpy(_buffer, _buf, self._inner.num * self._inner.buffer_length) - self._inner.buffer = _buffer - self._inner.is_null = _is_null - self._inner.length = _length - # ---------------------------------------- statement --------------------------------------------------------------- ^