def str_to_bool(parameter):
    """
    Utility for converting a string to its boolean equivalent.
    """
    if isinstance(parameter, bool):
        return parameter
    if parameter.lower() in {'false', 'f', '0', 'no', 'n'}:
        return False
    elif parameter.lower() in {'true', 't', '1', 'yes', 'y'}:
        return True
    raise ValueError(f'"{parameter}" is not a valid boolean value.')