code: def _deprecated(func):
      
      @wraps(func)
      def with_warning(*args, **kwargs):
          warnings.warn(
              ('The %s method is deprecated and will be removed in v2.*.*' %
               func.__name__),
              DeprecationWarning
          )
          return func(*args, **kwargs)
      return with_warning
docs: A decorator that warns about deprecation when the passed-in function is
      invoked.