(vals, attr, reverse=False)
return sorted(vals, key=lambda x: x[attr], reverse=reverse)
Sort sequence <vals> by using attribute/key <attr> for each item in the sequence.
Sort sequence <vals> by using attribute/key <attr> for each item in the sequence.
Sort sequence <vals > by using attribute / key <attr > for each item in the sequence .
def sorted_by_attr(vals, attr, reverse=False):
    """Sort sequence <vals> by using attribute/key <attr> for each item in the sequence."""
    return sorted(vals, key=lambda x: x[attr], reverse=reverse)
def sorted_by_attr ( vals , attr , reverse = False ) : return sorted ( vals , key = lambda x : x [ attr ] , reverse = reverse )