human
python How do you sort list by occurrence with out removing elements from the list?
assistant
Here is some code to sort list `lst` based on each element's number of occurrences

sorted(lst, key=lambda x: (-1 * c[x], lst.index(x)))

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