def _check_types()

in launcher/config_validator/type_validator.py [0:0]


def _check_types(argument, type, argument_name) -> None:
    if argument is None:
        return

    if type == "string" and not isinstance(argument, str):
        raise TypeError("{} with val {} is not a string".format(argument_name, argument))

    if type == "path" and not _is_valid_path(argument):
        raise TypeError("{} with val {} is not a valid path".format(argument_name, argument))

    if type == "list_string" and not _is_list_of_strings(argument):
        raise TypeError("{} with val {} is not a list of string".format(argument_name, argument))

    if type == "list_dict" and not _is_list_of_dicts(argument):
        raise TypeError("{} with val {} is not a list of dictionary".format(argument_name, argument))

    if type == "list_path" and not _is_list_of_paths(argument):
        raise TypeError("{} with val {} is not a list of paths".format(argument_name, argument))

    if type == "positive_integer" and not _is_positive_integer(argument):
        raise TypeError("{} with val {} is not a positive integer".format(argument_name, argument))

    if type == "dict" and not _is_dict(argument):
        raise TypeError("{} with val {} is not a dictionary".format(argument_name, argument))