def str_to_bool(val):
    """
    Helper function to turn a string representation of "true" into
    boolean True.
    """
    if isinstance(val, str):
        val = val.lower()
    return val in ['true', 'on', 'yes', True]
