helperFunctions.compare_sets module

helperFunctions.compare_sets.iter_element_and_rest(iterable)

Iterate over each element of an iterable object (e.g. a list) and also get all other (remaining) elements from the object.

Parameters:

iterable (Iterable[_T]) – The object that will be iterated over.

Returns:

A generator with tuples containing the item and the rest (all other elements).

Return type:

Iterator[tuple[_T, Iterable[_T]]]

helperFunctions.compare_sets.remove_duplicates_from_list(list_)

Remove duplicates from a list.

Parameters:
  • list – The input list (possibly) containing duplicates.

  • list_ (list[_T]) –

Returns:

A new list only containing unique elements.

Return type:

list[_T]

helperFunctions.compare_sets.substring_is_in_list(string, substring_list)

Check if any element in a list of strings is a substring of the provided string.

Parameters:
  • string (str) – The string that is checked if it contains any of the substrings.

  • substring_list (list[str]) – A list of possible substrings.

Returns:

True if a substring is found and False otherwise.

Return type:

bool