code: def deprecated(*optional_message):
      
      def _deprecated(func, *args, **kw):
          filename, lineno = get_culprit()
          user_msg = 'Call to deprecated function "%s". Called from %s line %i. %s' \
                     % (func.__name__, filename, lineno, msg)
  
          warnings.warn_explicit(
              user_msg,
              category=PyEMMA_DeprecationWarning,
              filename=filename,
              lineno=lineno
          )
          return func(*args, **kw)
  
      # add deprecation notice to func docstring:
      if len(optional_message) == 1 and callable(optional_message[0]):
          # this is the function itself, decorate!
          msg = ""
          return decorate(optional_message[0], _deprecated)
      else:
          # actually got a message (or empty parenthesis)
          msg = optional_message[0] if len(optional_message) > 0 else ""
          return decorator(_deprecated)
docs: This is a decorator which can be used to mark functions
      as deprecated. It will result in a warning being emitted
      when the function is used.
  
      Parameters
      ----------
      *optional_message : str
          an optional user level hint which should indicate which feature to use otherwise.