human
How to delete an item in a list if it exists?
assistant
Here is some code to delete an item `thing` in a list `some_list` if it exists

cleaned_list = [x for x in some_list if x is not thing]

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