Human: how do I sort a python list of dictionaries given a list of ids with the desired order? Assistant: 
Here is some code to sort a python list of dictionaries `users` by a given list `order` of ids 'id' with the desired order

users.sort(key=lambda x: order.index(x['id']))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.