Python script to remove duplicates