Takes a selection and reduces the selection to include only a single instance from each set of instances.
Make a sphere and instance it once. Make a 3rd sphere, copy it once. Select all 4 spheres. Run the script in UI mode. Hit Do. Now your 3rd, 4th and either the 1st or 2nd sphere is selected.