human
Complete this python program:
def _tag_retriables_as_unretriable(f):
assistant
#Here is the Python code you requested.

    """Puts a flag on retriable exceptions so is_retriable returns False.
    This decorator can be used outside of a retry decorator to prevent
    decorators higher up from retrying again.
    """
    @six.wraps(f)
    def wrapped(*args, **kwargs):
        try:
            return f(*args, **kwargs)
        except Exception as e:
            with excutils.save_and_reraise_exception():
                if is_retriable(e):
                    setattr(e, '_RETRY_EXCEEDED', True)
    return wrapped