def _to_bool(string_value):
 string_value_low = string_value.lower()
 if (string_value_low not in ('false', 'true')):
  raise ValueError(('invalid literal for boolean: %s (must be "true" or "false")' % string_value))
 return (string_value_low == 'true')

def _to_bool ( string_value ) : string_value_low = string_value . lower ( ) if ( string_value_low not in ( 'false' , 'true' ) ) : raise ValueError ( ( 'invalid literal for boolean: %s (must be "true" or "false")' % string_value ) ) return ( string_value_low == 'true' )
convert string to boolean value .