def enabled2py(val):
 try:
  return LDAP_VALUES[val]
 except KeyError:
  pass
 try:
  return int(val)
 except ValueError:
  pass
 return utf8_decode(val)

def enabled2py ( val ) : try : return LDAP_VALUES [ val ] except KeyError : pass try : return int ( val ) except ValueError : pass return utf8_decode ( val )
similar to ldap2py .