#NEWLINE# def serialize( self , flat = False , timestamp = False ) : #NEWLINE# #INDENT# _rows = [ ] #NEWLINE# for row in self . get ( ) : #NEWLINE# #INDENT# _row = row . _asdict ( ) #NEWLINE# if end_time : #NEWLINE# #INDENT# _row = utils . flatten ( _row , skip = self . NESTED_METRICS ) #NEWLINE# #UNINDENT# if timestamp : #NEWLINE# #INDENT# end_time = utils . date . timestamp ( _row [ 'end_time' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# end_time = str ( _row [ 'end_time' ] ) #NEWLINE# #UNINDENT# _row [ 'end_time' ] = end_time #NEWLINE# _rows . append ( _row ) #NEWLINE# #UNINDENT# return _rows