#NEWLINE# def aggregator( statistics_type , time_interval ) : #NEWLINE# #INDENT# assert ( statistics_type in mds . constants . STATISTICS_TYPES . values ( ) ) , statistics_type #NEWLINE# assert ( time_interval in mds . constants . TIME_INTERVALS . values ( ) ) , time_interval #NEWLINE# assert ( ( time_interval in mds . constants . WITHIN_TIME_INTERVALS ) ^ ( time_interval in mds . constants . OVER_TIME_INTERVALS ) ) #NEWLINE# result = None #NEWLINE# if ( statistics_type == mds . constants . COUNT ) : #NEWLINE# #INDENT# if ( time_interval in mds . constants . WITHIN_TIME_INTERVALS ) : #NEWLINE# #INDENT# result = count_per_time_interval #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = count_over_time_interval #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( statistics_type == mds . constants . MAX ) : #NEWLINE# #INDENT# if ( time_interval in mds . constants . WITHIN_TIME_INTERVALS ) : #NEWLINE# #INDENT# result = max_per_time_interval #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = max_over_time_interval #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( statistics_type == mds . constants . MEAN ) : #NEWLINE# #INDENT# if ( time_interval in mds . constants . WITHIN_TIME_INTERVALS ) : #NEWLINE# #INDENT# result = mean_per_time_interval #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = mean_over_time_interval #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( statistics_type == mds . constants . MIN ) : #NEWLINE# #INDENT# if ( time_interval in mds . constants . WITHIN_TIME_INTERVALS ) : #NEWLINE# #INDENT# result = min_per_time_interval #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = min_over_time_interval #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( statistics_type == mds . constants . RANGE ) : #NEWLINE# #INDENT# if ( time_interval in mds . constants . WITHIN_TIME_INTERVALS ) : #NEWLINE# #INDENT# result = range_per_time_interval #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = range_over_time_interval #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( statistics_type == mds . constants . STD ) : #NEWLINE# #INDENT# if ( time_interval in mds . constants . WITHIN_TIME_INTERVALS ) : #NEWLINE# #INDENT# result = std_per_time_interval #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = std_over_time_interval #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( statistics_type == mds . constants . SUM ) : #NEWLINE# #INDENT# if ( time_interval in mds . constants . WITHIN_TIME_INTERVALS ) : #NEWLINE# #INDENT# result = sum_per_time_interval #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = sum_over_time_interval #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# assert result #NEWLINE# return result