def METHOD_NAME(
    transformer, sagemaker_session, seconds=0, minutes=0, hours=0
):
    with timeout(seconds=seconds, minutes=minutes, hours=hours) as t:
        no_errors = False
        try:
            yield [t]
            no_errors = True
        finally:
            attempts = 3
            while attempts > 0:
                attempts -= 1
                try:
                    transformer.delete_model()
                    LOGGER.info("deleted SageMaker model {}".format(transformer.model_name))
                    _show_logs(transformer.model_name, "Models", sagemaker_session)
                    if no_errors:
                        _cleanup_logs(transformer.model_name, "Models", sagemaker_session)
                        break
                except ClientError as ce:
                    if ce.response["Error"]["Code"] == "ValidationException":
                        pass
                sleep(10)