Human: How to sort a list according to another list? Assistant: 
Here is some code to sort list `a` using the first dimension of the element as the key to list `b`

a.sort(key=lambda x: b.index(x[0]))

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