torchsig.utils.verify.verify_list¶
- torchsig.utils.verify.verify_list(list_check: list, name: str, no_duplicates: bool = False, data_type=None) list[source]¶
Verifies that the value list_check is a list and optionally checks for duplicates or verifies item types.
- Parameters:
list_check (list) – The value to be checked.
name (str) – The name of the value to be used in error messages.
no_duplicates (bool, optional) – If True, raises an error if the list contains duplicates. Defaults to False.
data_type (type, optional) – The type each item in the list should have. Defaults to None.
- Raises:
ValueError – If list_check is not a list, if it contains duplicates (when no_duplicates=True), or if any item in the list is not of the required type.
- Returns:
The verified list list_check.
- Return type: