# Path: openlego/utils/general_utils.py
# def change_object_type(obj, new_type):
#     # type: (Union[str, SupportsInt, SupportsFloat], str) -> Union[str, int, float]
#     """Attempts to change an object (usually a string) to a different object type."""
#     if new_type == 'str':
#         return str(obj)
#     elif new_type == 'int':
#         return int(obj)
#     elif new_type == 'float':
#         return float(obj)
#     else:
#         raise IOError('expected_type "{}" is not supported in this function.'.format(new_type))


import warnings
from copy import copy
from lxml.etree import _Element
from typing import Tuple, Union, Any, List
from openlego.utils.general_utils import change_object_type
        default : Any
            The default value of the setting if it is not found in the element.

        expected_type : str
            The expected type of the setting (str, int, float).

        doe_method : str
            The DOE method (LHS, Box-Behnken, etc.) of the DOE block.

        required_for_doe_methods : List[str]
            The DOE methods for which this setting must be found.

    Returns
    -------
        doe_setting : Union[str, int, float]
            The DOE setting that was found or its default value if it was not found.
    """
    if isinstance(doe_elem.find('settings/{}'.format(setting)), _Element):
        doe_setting = doe_elem.find('settings/{}'.format(setting)).text
    else:
        if required_for_doe_methods:
            if doe_method in required_for_doe_methods:
                warnings.warn('Setting "{}" unspecified for element "{}", setting to default "{}".'
                              .format(setting, doe_elem.attrib['uID'], default))
                doe_setting = default
            else:
                doe_setting = None
        else:
            doe_setting = None
    if doe_setting:

# Path: openlego/utils/general_utils.py
# def change_object_type(obj, new_type):
#     # type: (Union[str, SupportsInt, SupportsFloat], str) -> Union[str, int, float]
#     """Attempts to change an object (usually a string) to a different object type."""
#     if new_type == 'str':
#         return str(obj)
#     elif new_type == 'int':
#         return int(obj)
#     elif new_type == 'float':
#         return float(obj)
#     else:
#         raise IOError('expected_type "{}" is not supported in this function.'.format(new_type))


# Path: openlego/utils/cmdows_utils.py
import warnings
from copy import copy
from lxml.etree import _Element
from typing import Tuple, Union, Any, List
from openlego.utils.general_utils import change_object_type

        default : Any
            The default value of the setting if it is not found in the element.

        expected_type : str
            The expected type of the setting (str, int, float).

        doe_method : str
            The DOE method (LHS, Box-Behnken, etc.) of the DOE block.

        required_for_doe_methods : List[str]
            The DOE methods for which this setting must be found.

    Returns
    -------
        doe_setting : Union[str, int, float]
            The DOE setting that was found or its default value if it was not found.
    """
    if isinstance(doe_elem.find('settings/{}'.format(setting)), _Element):
        doe_setting = doe_elem.find('settings/{}'.format(setting)).text
    else:
        if required_for_doe_methods:
            if doe_method in required_for_doe_methods:
                warnings.warn('Setting "{}" unspecified for element "{}", setting to default "{}".'
                              .format(setting, doe_elem.attrib['uID'], default))
                doe_setting = default
            else:
                doe_setting = None
        else:
            doe_setting = None
    if doe_setting:

        return change_object_type(doe_setting, expected_type)