#NEWLINE# def _key_for_record( self , record ) : #NEWLINE# #INDENT# date = datetime . datetime . fromtimestamp ( record [ 'timestamp' ] ) #NEWLINE# if ( date_format . unit == 'day' ) : #NEWLINE# #INDENT# date_format = '%Y-%m-%d' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . unit == 'hour' ) : #NEWLINE# #INDENT# date_format = '%Y-%m-%d-%H' #NEWLINE# #UNINDENT# #UNINDENT# return date . strftime ( date_format )