code: def test_deprecation_warning_for_function():
      @deprecation_warning(msg="message", date="date")
      def sample_function():
          return "xxxx...."
  
      with pytest.warns(DeprecationWarning) as w:
          output = sample_function()
          assert output == "xxxx...."
          msg = (
              "sample_function will be deprecated on date.message in sagemaker>=2.\n"
              "See: https://sagemaker.readthedocs.io/en/stable/v2.html for details."
          )
          assert str(w[-1].message) == msg
  
file_path: sagemaker-python-sdk/tests/unit/test_deprecations.py
imports: from __future__ import absolute_import
  import pytest
  from sagemaker.deprecations import deprecated_class, deprecated_deserialize, deprecated_function, deprecated_serialize, removed_arg, removed_function, removed_kwargs, renamed_kwargs, deprecation_warning, deprecated
label_desc: Use image node_id 4 for calling a global function with example usage: test_deprecation_warning_for_function() and returns: str