def loose_bool(s: str) -> bool:
    """Tries to 'loosely' convert the given string to a boolean. This is done
    by first attempting to parse it into a number, then to a boolean. If this
    fails, a set of pre-defined words is compared case-insensitively to the
    string to determine whether it's positive/affirmative or negative.

    Parameters
    ----------
      * s: `str` - The string to convert.

    Returns
    -------
      * `bool`: The resulting boolean.

    Raises
    ------
      * `ValueError` when the boolean value can't be determined.
    """

    s = s.strip()

    try:
        return bool(float(s))
    except ValueError:
        pass

    s = s.lower()
    if s in ['y', 'yes', 't', 'true', 'do', 'ok']:
        return True
    elif s in ['n', 'no', 'f', 'false', 'dont']:
        return False

    else:
        raise ValueError(f"String {repr(s)} cannot be loosely casted to a boolean")