def lod_sort_by_key(_list, indexkey):
 _list.sort((lambda a, b: (a[indexkey] < b[indexkey])))
 return _list

def lod_sort_by_key ( _list , indexkey ) : _list . sort ( ( lambda a , b : ( a [ indexkey ] < b [ indexkey ] ) ) ) return _list
sorts a list of dictionaries by a given key in the dictionaries note: this is a destructive operation .