#NEWLINE# def append( self , raw , query ) : #NEWLINE# #INDENT# self . raw . append ( raw ) #NEWLINE# self . queries . append ( query ) #NEWLINE# self . metrics . update ( query . raw [ 'metrics' ] ) #NEWLINE# self . dimensions . update ( query . raw . get ( 'dimensions' , [ ] ) ) #NEWLINE# self . is_complete = ( not ( 'nextLink' in raw ) ) #NEWLINE# casters = [ column . cast for column in self . headers ] #NEWLINE# for row in self . raw [ ( - 1 ) ] . get ( 'rows' , [ ] ) : #NEWLINE# #INDENT# typed_row = [ casters [ i ] ( row [ i ] ) for i in range ( len ( self . headers ) ) ] #NEWLINE# typed_tuple = self . row_cls ( * typed_row ) #NEWLINE# self . rows . append ( typed_tuple ) #NEWLINE# #UNINDENT# self . totals = raw [ 'totalsForAllResults' ] #NEWLINE# self . total = list ( raw [ 'totalsForAllResults' ] . values ( ) ) [ 0 ]