code: def test_method_modify_node(methods, caplog):
      modifier = image_uris.ImageURIRetrieveRefactor()
  
      method = "get_image_uri('us-west-2', 'xgboost')"
      node = ast_call(method)
      modifier.modify_node(node)
      assert (
          "image_uris.retrieve('xgboost', 'us-west-2')"
          == pasta.dump(node)
      )
  
      method = "amazon_estimator.get_image_uri('us-west-2', 'xgboost')"
      node = ast_call(method)
      modifier.modify_node(node)
      assert (
          "image_uris.retrieve('xgboost', 'us-west-2')"
          == pasta.dump(node)
      )
  
      method = "sagemaker.get_image_uri(repo_region='us-west-2', repo_name='xgboost')"
      node = ast_call(method)
      modifier.modify_node(node)
      assert (
          "sagemaker.image_uris.retrieve('xgboost', 'us-west-2')"
          == pasta.dump(node)
      )
  
      method = "sagemaker.amazon_estimator.get_image_uri('us-west-2', repo_name='xgboost')"
      node = ast_call(method)
      modifier.modify_node(node)
      assert (
          "sagemaker.image_uris.retrieve('xgboost', 'us-west-2')"
          == pasta.dump(node)
      )
  
      method = "sagemaker.amazon.amazon_estimator.get_image_uri('us-west-2', 'xgboost', repo_version='1')"
      node = ast_call(method)
      modifier.modify_node(node)
      assert (
          "sagemaker.image_uris.retrieve('xgboost', 'us-west-2', '1')"
          == pasta.dump(node)
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/cli/compatibility/v2/modifiers/test_algorithm_image_uris.py
imports: from __future__ import absolute_import
  import pasta
  import pytest
  from sagemaker.cli.compatibility.v2.modifiers import image_uris
  from tests.unit.sagemaker.cli.compatibility.v2.modifiers.ast_converter import ast_call, ast_import
label_desc: Use image node_id 5 for calling a global function with example usage: test_method_modify_node(methods, caplog) without return types