code: def _decorate_func(func, deprecate_from, deprecate_to, msg):
      msg_template = (
          "Function {name} is deprecated from {deprecate_from} version."
      )
      msg_template += (
          " It will be removed from {deprecate_to} version. {msg}"
      )
  
      @functools.wraps(func)
      def wrapped(*args, **kwargs):
          warnings.simplefilter("always", DeprecationWarning)
          warnings.warn(
              msg_template.format(
                  name=func.__name__,
                  deprecate_from=deprecate_from,
                  deprecate_to=deprecate_to,
                  msg=msg,
              ),
              category=DeprecationWarning,
          )
          warnings.simplefilter("default", DeprecationWarning)
          return func(*args, **kwargs)
  
      return wrapped
  
imports: import functools
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: _decorate_func(func, deprecate_from, deprecate_to, msg) and returns: wrapped, func