def METHOD_NAME(self, *args, **kwargs):
    if kwargs["auto"]:
        self.stdout.write("Automatically merging duplicate clubs...")
        duplicates = (
            Club.objects.values("name")
            .annotate(name_count=Count("name"))
            .filter(name_count__gt=1)
        )
        duplicates = [x["name"] for x in duplicates]
        for duplicate in duplicates:
            clubs = Club.objects.filter(name=duplicate)
            num_clubs = clubs.count()
            final, rest = clubs[0], clubs[1:]
            for item in rest:
                final = merge_clubs(final, item)
            self.stdout.write(
                self.style.SUCCESS("Merged {} ({})".format(duplicate, num_clubs))
            )
    else:
        items = kwargs["items"]
        if kwargs["tag"]:
            tags = Tag.objects.filter(name__in=items)
            if tags.count() < 2:
                raise CommandError("You must specify at least two tags to merge!")
            final, rest = tags[0], tags[1:]
            for item in rest:
                final = merge_tags(final, item)
            self.stdout.write(self.style.SUCCESS("Merged {}".format(final.name)))
        else:
            clubs = Club.objects.filter(Q(code__in=items) | Q(name__in=items))
            if clubs.count() < 2:
                raise CommandError("You must specify at least two clubs to merge!")
            final, rest = clubs[0], clubs[1:]
            for item in rest:
                final = merge_clubs(final, item)
            self.stdout.write(self.style.SUCCESS("Merged {}".format(final.name)))