def skip(instance, action, peek=False, unskip=False):
    """Returns True if the transition is to be SKIPPED

        peek - True just checks the value, does not set.
        unskip - remove skip key (for manual overrides).

    called with only (instance, action_id), this will set the request variable preventing the
    cascade's from re-transitioning the object and return None.
    """
    uid = callable(instance.UID) and instance.UID() or instance.UID
    skipkey = '%s_%s' % (uid, action)
    if 'workflow_skiplist' not in instance.REQUEST:
        if not peek and not unskip:
            instance.REQUEST['workflow_skiplist'] = [skipkey]
    elif skipkey in instance.REQUEST['workflow_skiplist']:
        if unskip:
            instance.REQUEST['workflow_skiplist'].remove(skipkey)
        else:
            return True
    elif not peek and not unskip:
        instance.REQUEST['workflow_skiplist'].append(skipkey)
