def boolean(value):
    """Turn the given string value into a boolean.

    Any truthy value will be interpreted as True and anything else will
    be False. For convenience, this function will also accept a boolean
    value (and simply return it) and the value None, which will be
    interpreted as False.
    """
    if isinstance(value, bool) or value is None:
        return bool(value)
    return value.lower() in ('true', 't', 'yes', 'y', '1')