human
Sort a nested list by two elements
assistant
Here is some code to sort a nested list by the inverse of element 2, then by element 1

sorted(l, key=lambda x: (-int(x[1]), x[0]))

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