def METHOD_NAME(self, instance, model, stop_date=None, dry_run=True):
    entries_deleted = 0
    history = utils.get_history_manager_for_model(instance)
    o_qs = history.all()
    if stop_date:
        # to compare last history match
        extra_one = o_qs.filter(history_date__lte=stop_date).first()
        o_qs = o_qs.filter(history_date__gte=stop_date)
    else:
        extra_one = None
    with transaction.atomic():
        # ordering is ('-history_date', '-history_id') so this is ok
        f1 = o_qs.first()
        if not f1:
            return
        for f2 in o_qs[1:]:
            entries_deleted += self._check_and_delete(f1, f2, dry_run)
            f1 = f2
        if extra_one:
            entries_deleted += self._check_and_delete(f1, extra_one, dry_run)
    self.log(
        self.DONE_CLEANING_FOR_MODEL.format(model=model, count=entries_deleted)
    )