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

def _refine_mode(mode):
    '''
    Return a mode value that is predictable
    '''
    mode = six.text_type(mode).lower()
    if any([mode.startswith('e'),
            mode == '1',
            mode == 'on']):
        return 'Enforcing'
    if any([mode.startswith('p'),
            mode == '0',
            mode == 'off']):
        return 'Permissive'
    if any([mode.startswith('d')]):
        return 'Disabled'
    return 'unknown'