code: def deprecated(message, stacklevel=2):  # pragma: no cover
      
  
      def _decorator(func):
          @wraps(func)
          def _func(*args, **kwargs):
              warnings.warn(
                  "'{}' is deprecated. {}".format(func.__name__, message),
                  category=DeprecationWarning,
                  stacklevel=stacklevel
              )
              return func(*args, **kwargs)
          return _func
      return _decorator
docs: Raise a `DeprecationWarning` when wrapped function/method is called.
  
      Borrowed from https://stackoverflow.com/a/48632082/866026