#NEWLINE# def normalize_list( L ) : #NEWLINE# #INDENT# 'Normalize an array of numbers such that each element satisfies:\n        0 <= e <= 1\n    ' #NEWLINE# if ( not L ) : #NEWLINE# #INDENT# return L #NEWLINE# #UNINDENT# max_ = max ( L ) #NEWLINE# if ( max_ > 0 ) : #NEWLINE# #INDENT# return [ ( float ( e ) / max_ ) for e in L ] #NEWLINE# #UNINDENT# return max_