hpcflow.sdk.core.utils.get_item_repeat_index#
- hpcflow.sdk.core.utils.get_item_repeat_index(lst, *, distinguish_singular=False, item_callable=None)#
Get the repeat index for each item in a list.
- Parameters:
lst (list) – Must contain hashable items, or hashable objects that are returned via callable called on each item.
distinguish_singular (bool) – If True, items that are not repeated will have a repeat index of 0, and items that are repeated will have repeat indices starting from 1.
item_callable (callable) – If specified, comparisons are made on the output of this callable on each item.
- Returns:
repeat_idx – Repeat indices of each item (see distinguish_singular for details).
- Return type: