check compatibility of accept_keywords

def _check_accept_keywords(approved, flag):
    '''check compatibility of accept_keywords'''
    if flag in approved:
        return False
    elif (flag.startswith('~') and flag[1:] in approved) \
            or ('~'+flag in approved):
        return False
    else:
        return True