def bool_param(value, default=None):
    """Coverts string param into boolean"""
    if isinstance(value, bool):
        result = value
    else:
        value = '' if value is None else value.lower()
        if value in ('1', 'true', 'yes', 'y', 'on'):
            result = True
        elif value in ('0', 'false', 'no', 'n', 'off'):
            result = False
        else:
            result = default
    return result
