baybe.utils.boolean.strtobool¶
- baybe.utils.boolean.strtobool(val: str)[source]¶
Convert a string representation of truth to
True
orFalse
.Adapted from distutils. True values are
y
,yes
,t
,true
,on
, and1
. False values aren
,no
,f
,false
,off
, and0
. Raises aValueError
ifval
is anything else.- Parameters:
val (
str
) – String to be checked.- Return type:
- Returns:
The
bool
value of the corresponding string representation.- Raises:
ValueError – If
val
cannot be evaluated to a suitable boolean value.