#NEWLINE# @ current_app . template_filter ( ) #NEWLINE# def max_key( value , key ) : #NEWLINE# #INDENT# "Returns the maximum value in a 'column' in a list of dictionaries or objects.\n\n    Positional arguments:\n    value -- list of dictionaries or objects to iterate through.\n\n    Returns:\n    Sum of the values.\n    " #NEWLINE# values = [ ( r . get ( key , 0 ) if hasattr ( r , 'get' ) else getattr ( r , key , 0 ) ) for r in value ] #NEWLINE# return max ( values )