code: def test_algorithm_create_transformer_without_completed_training_job(
      session,
  ):
      session.sagemaker_config = {}
      session.sagemaker_client.describe_algorithm = Mock(
          return_value=DESCRIBE_ALGORITHM_RESPONSE
      )
  
      estimator = AlgorithmEstimator(
          algorithm_arn="arn:aws:sagemaker:us-east-2:1234:algorithm/scikit-decision-trees",
          role="SageMakerRole",
          instance_type="ml.m4.xlarge",
          instance_count=1,
          sagemaker_session=session,
      )
  
      with pytest.raises(RuntimeError) as error:
          estimator.transformer(
              instance_count=1, instance_type="ml.m4.xlarge"
          )
          assert (
              "No finished training job found associated with this estimator"
              in str(error)
          )
  
imports: from __future__ import absolute_import
  import copy
  import datetime
  import pytest
  from mock import Mock, patch
  from sagemaker.algorithm import AlgorithmEstimator
  from sagemaker.estimator import _TrainingJob
  from sagemaker.transformer import Transformer
label_desc: Use image node_id 17 for calling a global function with example usage: test_algorithm_create_transformer_without_completed_training_job(session) without return types