code: def test_constructor_modify_node():
      modifier = predictors.PredictorConstructorRefactor()
  
      node = ast_call("sagemaker.RealTimePredictor(endpoint='a')")
      modifier.modify_node(node)
      assert "sagemaker.Predictor(endpoint_name='a')" == pasta.dump(
          node
      )
  
      node = ast_call("RealTimePredictor(endpoint='a')")
      modifier.modify_node(node)
      assert "Predictor(endpoint_name='a')" == pasta.dump(node)
  
      node = ast_call(
          "sagemaker.amazon.kmeans.KMeansPredictor(endpoint='a')"
      )
      modifier.modify_node(node)
      assert (
          "sagemaker.amazon.kmeans.KMeansPredictor(endpoint_name='a')"
          == pasta.dump(node)
      )
  
      node = ast_call("KMeansPredictor(endpoint='a')")
      modifier.modify_node(node)
      assert "KMeansPredictor(endpoint_name='a')" == pasta.dump(node)
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/cli/compatibility/v2/modifiers/test_predictors.py
imports: from __future__ import absolute_import
  import pasta
  import pytest
  from sagemaker.cli.compatibility.v2.modifiers import predictors
  from tests.unit.sagemaker.cli.compatibility.v2.modifiers.ast_converter import ast_call, ast_import
label_desc: Use image node_id 9 for calling a global function with example usage: test_constructor_modify_node() without return types