code: def test_retrieve_with_pipeline_variable():
      kwargs = dict(
          framework="tensorflow",
          version="1.15",
          py_version="py3",
          instance_type="ml.m5.xlarge",
          region="us-east-1",
          image_scope="training",
      )
      # instance_type is plain string which should not break anything
      image_uris.retrieve(**kwargs)
  
      # instance_type is parameter string with not None default value
      # which should not break anything
      kwargs["instance_type"] = ParameterString(
          name="TrainingInstanceType",
          default_value="ml.m5.xlarge",
      )
      image_uris.retrieve(**kwargs)
  
      # instance_type is parameter string without default value
      # (equivalent to pass in None to instance_type field)
      # which should fail due to empty instance type check
      kwargs["instance_type"] = ParameterString(
          name="TrainingInstanceType"
      )
      with pytest.raises(Exception) as error:
          image_uris.retrieve(**kwargs)
      assert "Empty SageMaker instance type" in str(error.value)
  
      # instance_type is other types of pipeline variable
      # which should break loudly
      kwargs["instance_type"] = Join(on="", values=["a", "b"])
      with pytest.raises(Exception) as error:
          image_uris.retrieve(**kwargs)
      assert (
          "the argument instance_type should not be a pipeline variable"
          in str(error.value)
      )
  
      # instance_type (ParameterString) is given as args rather than kwargs
      # which should not break anything
      image_uris.retrieve(
          "tensorflow",
          "us-east-1",
          "1.15",
          "py3",
          ParameterString(
              name="TrainingInstanceType",
              default_value="ml.m5.xlarge",
          ),
          image_scope="training",
      )
  
imports: from __future__ import absolute_import
  import copy
  import logging
  import pytest
  from mock import patch
  from sagemaker import image_uris
  from sagemaker.workflow.functions import Join
  from sagemaker.workflow.parameters import ParameterString
label_desc: Use image node_id 24 for calling a global function with example usage: test_retrieve_with_pipeline_variable() without return types