def parse_bool(text):
 if (text.lower() in ('true', '1')):
  return True
 elif (text.lower() in ('false', '0')):
  return False
 raise Exception(('Invalid boolean: %s' % text))

def parse_bool ( text ) : if ( text . lower ( ) in ( 'true' , '1' ) ) : return True elif ( text . lower ( ) in ( 'false' , '0' ) ) : return False raise Exception ( ( 'Invalid boolean: %s' % text ) )
parses a boolean text and converts it into boolean value .