backend/api/main.py
def format_dict_counter(dict_counter):
    """
    Format dictionary and rank by sum
    """
    result = []
    for k, v in sorted(dict_counter.items(), key=lambda item: item[1], reverse=True):
        result.append({"budget_type": k, "amount": v})
    return result

    Format dictionary and rank by sum
    
Format dictionary and rank by sum
Format dictionary and rank by sum
def format_dict_counter(dict_counter):
    result = []
    for k, v in sorted(dict_counter.items(), key=lambda item: item[1], reverse=True):
        result.append({"budget_type": k, "amount": v})
    return result
def format_dict_counter ( dict_counter ) : result = [ ] for k , v in sorted ( dict_counter . items ( ) , key = lambda item : item [ 1 ] , reverse = True ) : result . append ( { "budget_type" : k , "amount" : v } ) return result
Format dictionary and rank by sum
Format dictionary and rank by sum
"""
    Format dictionary and rank by sum
    """
dict_counter