How to remove duplicates in a nested list of objects in python,"sorted(item, key=lambda x: x.id)"