#NEWLINE# def decode_timeseries( self , resp_ttb , tsobj ) : #NEWLINE# #INDENT# '\n        Fills an TsObject with the appropriate data and\n        metadata from a TTB-encoded TsGetResp / TsQueryResp.\n\n        :param resp_ttb: the decoded TTB data\n        :type resp_ttb: TTB-encoded tsqueryrsp or tsgetresp\n        :param tsobj: a TsObject\n        :type tsobj: TsObject\n        ' #NEWLINE# if ( resp_ttb is None ) : #NEWLINE# #INDENT# return tsobj #NEWLINE# #UNINDENT# self . maybe_err_ttb ( resp_ttb ) #NEWLINE# resp_a = resp_ttb [ 0 ] #NEWLINE# if ( resp_a == tsputresp_a ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( resp_a == tsgetresp_a ) or ( resp_a == tsqueryresp_a ) ) : #NEWLINE# #INDENT# resp_data = resp_ttb [ 1 ] #NEWLINE# if ( len ( resp_data ) == 0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( resp_data ) == 3 ) : #NEWLINE# #INDENT# resp_colnames = resp_data [ 0 ] #NEWLINE# resp_coltypes = resp_data [ 1 ] #NEWLINE# tsobj . columns = self . decode_timeseries_cols ( resp_colnames , resp_coltypes ) #NEWLINE# resp_rows = resp_ttb [ 2 ] #NEWLINE# tsobj . rows = [ ] #NEWLINE# for resp_row in resp_rows : #NEWLINE# #INDENT# tsobj . rows . append ( self . decode_timeseries_row ( resp_row , resp_coltypes ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise RiakError ( 'Expected 3-tuple in response, got: {}' . format ( resp_data ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise RiakError ( 'Unknown TTB response type: {}' . format ( resp_a ) )