Marks a function as deprecated.

def deprecated(func, *args, **kwargs):
    ''' Marks a function as deprecated. '''
    warnings.warn(
        '{} is deprecated and should no longer be used.'.format(func),
        DeprecationWarning,
        stacklevel=3
    )
    return func(*args, **kwargs)