def _to_bool(text):
    """Convert str value to bool.

    Returns True if text is "True" or "1" and False if text is "False" or "0".

    Args:
        text: str value

    Returns:
        bool
    """
    if text.title() in ("True", "1"):
        result = True
    elif text.title() in ("False", "0"):
        result = False
    else:
        raise ValueError("Expected 'True', 'False', '1', '0'; got '%s'" % text)

    return result