def handle(self, *args, **options):
        self.stdout.write('Collecting duplicates...')
        duplicates = sum([self.get_quota_duplicate_versions(quota) for quota in Quota.objects.all()], [])
        self.stdout.write('...Done')

        if not duplicates:
            self.stdout.write('No duplicates were found. Congratulations!')
        else:
            self.stdout.write('There are %s duplicates for quotas versions.' % len(duplicates))
            while True:
                delete = raw_input('  Do you want to delete them? [Y/n]:') or 'y'
                if delete.lower() not in ('y', 'n'):
                    self.stdout.write('  Please enter letter "y" or "n"')
                else:
                    delete = delete.lower() == 'y'
                    break
            if delete:
                for duplicate in duplicates:
                    duplicate.delete()
                self.stdout.write('All duplicates were deleted.')
            else:
                self.stdout.write('Duplicates were not deleted.')
dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/quotas/management/commands/clearquotashistory.py/Command.handle/original