(
self,
arr: List,
sort_fn: Callable,
group_fn: Callable = lambda x: x[1],
grouping: bool = False,
)
| 360 | """ |
| 361 | |
| 362 | def __init__( |
| 363 | self, |
| 364 | arr: List, |
| 365 | sort_fn: Callable, |
| 366 | group_fn: Callable = lambda x: x[1], |
| 367 | grouping: bool = False, |
| 368 | ) -> None: |
| 369 | self.grouping = grouping |
| 370 | self.fn = sort_fn |
| 371 | self.group_fn = lambda x: group_fn(x[1]) # first index are enumerated indices |
| 372 | self.reorder_indices: List = [] |
| 373 | self.size = len(arr) |
| 374 | self.arr_with_indices: Iterable[Any] = tuple(enumerate(arr)) # [indices, (arr)] |
| 375 | if self.grouping is True: |
| 376 | self.group_by_index() |
| 377 | |
| 378 | def group_by_index(self) -> None: |
| 379 | self.arr_with_indices = self.group( |
nothing calls this directly
no test coverage detected