def transform_to_bool(value):
    """
    Transforms a certain set of values to True or False.
    True can be represented by '1', 'True' and 'true.'
    False can be represented by '1', 'False' and 'false.'

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

    Transforms a certain set of values to True or False.
    True can be represented by '1', 'True' and 'true.'
    False can be represented by '1', 'False' and 'false.'

    Any other representation will be rejected.
    
st2api/st2api/controllers/controller_transforms.py