@any_model.register_default
def any_model_default(model_cls, **kwargs):
    result = model_cls()

    attempts = 10
    while True:
        try:
            _fill_model_fields(result, **kwargs)
            result.full_clean()
            result.save()
            return result
        except (IntegrityError, __HOLE__):
            attempts -= 1
            if not attempts:
                raise
dataset/ETHPy150Open kmmbvnr/django-any/django_any/models.py/any_model_default