def bool_val(string):
    """
    Returns a boolean value of a string.

    Examples:
        >>> bool_val('yes')
        True
        >>> bool_val('True')
        True
        >>> bool_val('0')
        False
    Args:
        string (str): string to be evaluated

    """
    val = string.lower() in ['true', 't', 'y', 'yes']
    try: val |= bool(int(string))
    except ValueError: pass
    return val