(ival)
return None
Function to take an input that may be a string, an int or a bool
    If input is a string it is made lowecase
    Returns True if ival is boolean True, a non-zero integer, "Yes",
    "True" or "1"
    Returns False in ival is boolean False, zero, "No", "False" or "0"
    In all other cases, returns None
Function to take an input that may be a string, an int or a bool
    If input is a string it is made lowecase
    Returns True if ival is boolean True, a non-zero integer, "Yes",
    "True" or "1"
    Returns False in ival is boolean False, zero, "No", "False" or "0"
    In all other cases, returns None
Function to take an input that may be a string an int or a bool If input is a string it is made lowecase Returns True if ival is boolean True a non - zero integer Yes True or 1 Returns False in ival is boolean False zero No False or 0 In all other cases returns None
def parameter_cast_to_bool(ival):
    """
    Function to take an input that may be a string, an int or a bool
    If input is a string it is made lowecase
    Returns True if ival is boolean True, a non-zero integer, "Yes",
    "True" or "1"
    Returns False in ival is boolean False, zero, "No", "False" or "0"
    In all other cases, returns None
    """
    if type(ival) is bool:
        return ival
    if type(ival) is int:
        return bool(ival)
    if type(ival) is str:
        lower = ival.lower()
        if lower == 'no' or lower == 'false' or lower == '0':
            return False
        if lower == 'yes' or lower == 'true' or lower == '1':
            return True
    return None
def parameter_cast_to_bool ( ival ) : if type ( ival ) is bool : return ival if type ( ival ) is int : return bool ( ival ) if type ( ival ) is str : lower = ival . lower ( ) if lower == 'no' or lower == 'false' or lower == '0' : return False if lower == 'yes' or lower == 'true' or lower == '1' : return True return None