import struct def access_bit(data, num): base = num // 8 shift = 7 - num % 8 return (data[base] >> shift) & 0x1 def unpack_fix_data(data, entry_type): taos_type_null = 0 taos_type_bool = 1 taos_type_tinyint = 2 taos_type_smallint = 3 taos_type_int = 4 taos_type_bigint = 5 taos_type_float = 6 taos_type_double = 7 taos_type_timestamp = 9 taos_type_utinyint = 11 taos_type_usmallint = 12 taos_type_uint = 13 taos_type_ubigint = 14 taos_type_decimal = 17 taos_type_blob = 18 taos_type_mediumblob = 19 taos_type_decimal64 = 21 # taos_type_varchar = 8 # taos_type_binary = taos_type_varchar # taos_type_nchar = 10 # taos_type_json = 15 # taos_type_varbinary = 16 # taos_type_geometry = 20 if entry_type == taos_type_null: return 'null' elif entry_type == taos_type_bool: return data elif entry_type == taos_type_tinyint: return data elif entry_type == taos_type_smallint: return int(struct.unpack(' 0: block = parse(rba, start_idx) blen = block["len"] start_idx += blen rbalen -= blen bl.append(block) return bl