#NEWLINE# def as_dict( self , with_metadata = False ) : #NEWLINE# #INDENT# serialized = [ ] #NEWLINE# for row in self . rows : #NEWLINE# #INDENT# row = row . _asdict ( ) #NEWLINE# for ( key , value ) in row . items ( ) : #NEWLINE# #INDENT# row [ key ] = utils . date . serialize ( value ) #NEWLINE# #UNINDENT# serialized . append ( self ) #NEWLINE# #UNINDENT# if with_metadata : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# 'title' : self . queries [ 0 ] . title , #NEWLINE# 'queries' : self . queries , #NEWLINE# 'metrics' : self . metrics , #NEWLINE# 'dimensions' : self . dimensions , #NEWLINE# 'results' : serialized , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return serialized