utils.py
def str_to_bool(argument):
    """
    Function to convert a string to a boolean value.
    :param argument: String to be converted.
    :return: Boolean value.
    """

    # Checks if the argument is already a boolean value.
    if isinstance(argument, bool): return argument

    # Returns boolean depending on the input string.
    if argument.lower() == "true" or argument.lower() == 't':
        return True
    elif argument.lower() == "false" or argument.lower() == 'f':
        return False

    # Returns an error if the value is not converted to a boolean value.
    return ArgumentTypeError(f"Boolean value expected. Got \"{argument}\".")

    Function to convert a string to a boolean value.
    :param argument: String to be converted.
    :return: Boolean value.
    
Function to convert a string to a boolean value.
Function to convert a string to a boolean value .
def str_to_bool(argument):
    if isinstance(argument, bool): return argument
    if argument.lower() == "true" or argument.lower() == 't':
        return True
    elif argument.lower() == "false" or argument.lower() == 'f':
        return False
    return ArgumentTypeError(f"Boolean value expected. Got \"{argument}\".")
def str_to_bool ( argument ) : if isinstance ( argument , bool ) : return argument if argument . lower ( ) == "true" or argument . lower ( ) == 't' : return True elif argument . lower ( ) == "false" or argument . lower ( ) == 'f' : return False return ArgumentTypeError ( f"Boolean value expected. Got \"{argument}\"." )
Function to convert a string to a boolean value.
Function to convert a string to a boolean value .
"""
    Function to convert a string to a boolean value.
    :param argument: String to be converted.
    :return: Boolean value.
    """ # Checks if the argument is already a boolean value. # Returns boolean depending on the input string. # Returns an error if the value is not converted to a boolean value.
None
argument
String to be converted.
String to be converted .