code: def deprecated(comment=None, replacement=None):
      
      def decorator(func):
          def wrapper(*args, **kwargs):
              message = "Call to deprecated function '{}.{}'".format(
                  func.__module__,
                  func.__name__)
              if replacement and isinstance(replacement, str):
                  message += ". Use '{}' instead".format(replacement)
              elif replacement:
                  message += ". Use '{}.{}' instead".format(
                   replacement.__module__,
                   replacement.__name__)
              if comment:
                  message += ". {}".format(comment)
              warnings.simplefilter('always', DeprecationWarning)
              warnings.warn(message, category=DeprecationWarning, stacklevel=2)
              warnings.simplefilter('default', DeprecationWarning)
              return func(*args, **kwargs)
          return wrapper
      return decorator
docs: Flags a function as deprecated. A warning will be emitted.
  
      :param comment: A human-friendly string, such as 'This  function
                      will be removed soon'
      :type comment: string
      :param replacement: The function to be used instead
      :type replacement: string or function