def to_bool(value):
    """Return boolean value. Convert string to True when "true", "yes" or "on"
    """
    if isinstance(value, str):
        value = value.lower()
        return value in ['1', 'true', 'yes', 'on'] and value != '0'
    else:
        return bool(value)
