def deprecated(func):
    """A decorator used to mark functions as deprecated.

    Emit a warning when the decorated function is called.

    """
    @wraps(func)
    def wrapper(*args, **kwargs):
        """Emit a warning, then call ``func``."""
        old_name = func.__name__
        if old_name == 'codify':
            new_name = '_make_unicode'
        else:
            new_name = old_name.replace('generate', 'gen')
        warnings.warn(
            '{0} is deprecated! Please use {1} instead.'
            .format(old_name, new_name),
            category=Warning
        )
        return func(*args, **kwargs)
    return wrapper
dataset/ETHPy150Open omaciel/fauxfactory/fauxfactory/__init__.py/deprecated/original