def transform_to_bool(value):
 if (value in ['1', 'true', 'True']):
  return True
 elif (value in ['0', 'false', 'False']):
  return False
 raise ValueError(('Invalid bool representation "%s" provided.' % value))

def transform_to_bool ( value ) : if ( value in [ '1' , 'true' , 'True' ] ) : return True elif ( value in [ '0' , 'false' , 'False' ] ) : return False raise ValueError ( ( 'Invalid bool representation "%s" provided.' % value ) )
transforms a certain set of values to true or false .