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