def METHOD_NAME(self, base: ExerciseBase, delete: bool):
    if not base.pk:
        return
    exercise_languages = base.exercises.values_list('language', flat=True)
    duplicates = [
        Language.objects.get(pk=item)
        for item, count in collections.Counter(exercise_languages).items() if count > 1
    ]
    if not duplicates:
        return
    warning = f'Exercise {base.uuid} has duplicate translations!'
    self.stdout.write(self.style.WARNING(warning))
    # Output the duplicates
    for language in duplicates:
        translations = base.exercises.filter(language=language)
        self.stdout.write(f'language {language.short_name}:')
        for translation in translations:
            self.stdout.write(f'  * {translation.name} {translation.uuid}')
        self.stdout.write('')
        # And delete them
        if delete:
            self.stdout.write(f'  Deleting all but first {language.short_name} translation')
            for translation in translations[1:]:
                translation.delete()