human
python: sort a list of lists by an item in the sublist
assistant
Here is some code to sort list `li` in descending order based on the second element of each list inside list`li`

sorted(li, key=operator.itemgetter(1), reverse=True)

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