def BOOL(value):
 if (value in (u'1', u'0')):
  return bool(int(value))
 raise ValueError((u'%r is not 0 or 1' % value))

def BOOL ( value ) : if ( value in ( u'1' , u'0' ) ) : return bool ( int ( value ) ) raise ValueError ( ( u'%r is not 0 or 1' % value ) )
convert the values 0 and 1 into booleans .