<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

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