def ParseBool(text):
 if (text in ('true', 't', '1')):
  return True
 elif (text in ('false', 'f', '0')):
  return False
 else:
  raise ValueError('Expected "true" or "false".')

def ParseBool ( text ) : if ( text in ( 'true' , 't' , '1' ) ) : return True elif ( text in ( 'false' , 'f' , '0' ) ) : return False else : raise ValueError ( 'Expected "true" or "false".' )
parse a boolean value .