code: def deprecation_warning(date, msg=None):
      """Decorator for raising deprecation warning for a feature in sagemaker>=2
  
      Args:
          date (str): the date when the feature will be deprecated
          msg (str): the prefix phrase of the warning message.
  
      Usage:
          @deprecation_warning(msg="message", date="date")
          def sample_function():
              print("xxxx....")
  
          @deprecation_warning(msg="message", date="date")
          class SampleClass():
              def __init__(self):
                  print("xxxx....")
  
      """
  
      def deprecate(obj):
          def wrapper(*args, **kwargs):
              deprecation_warn(obj.__name__, date, msg)
              return obj(*args, **kwargs)
  
          return wrapper
  
      return deprecate
  
file_path: sagemaker-python-sdk/src/sagemaker/deprecations.py
imports: from __future__ import absolute_import
  import logging
  import warnings
label_desc: Use image node_id 6 for calling a global function with example usage: deprecation_warning(date, msg) and returns: deprecate, wrapper, obj