def _refine_mode(mode):
 mode = str(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'

def _refine_mode ( mode ) : mode = str ( 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'
return a mode value that is predictable .