def sorted_counter(counter):
    """
    Return a list of ordered mapping of {value:val, count:cnt} built from a
    `counter` mapping of {value: count} and sortedd by decreasing count then by
    value.
    """

    def by_count_value(value_count):
        value, count = value_count
        return -count, value or ''

    summarized = [
        dict([('value', value), ('count', count)])
        for value, count in sorted(counter.items(), key=by_count_value)]
    return summarized