import warnings


def deprecated(func):
    """Deprecation warning decorator
    """
    def inner(*args, **kwargs):
        warnings.warn("Call to deprecated method {}".format(func.__name__),
                      category=DeprecationWarning, stacklevel=2)
        return func(*args, **kwargs)
    inner.__name__ = func.__name__
    inner.__doc__ = func.__doc__
    inner.__dict__.update(func.__dict__)
    return inner