Given a total and a divisor, return two tuples: A tuple containing `divisor` repeated the number of times it divides `total`, and length-1 or empty tuple containing the remainder when `total` is divided by `divisor`. If `divisor` factors `total`, i.e. if the remainder is 0, then `remaind
(total: int, divisor: int)
| 2311 | |
| 2312 | |
| 2313 | def _partition(total: int, divisor: int) -> tuple[tuple[int, ...], tuple[int, ...]]: |
| 2314 | """Given a total and a divisor, return two tuples: A tuple containing `divisor` |
| 2315 | repeated the number of times it divides `total`, and length-1 or empty tuple |
| 2316 | containing the remainder when `total` is divided by `divisor`. If `divisor` factors |
| 2317 | `total`, i.e. if the remainder is 0, then `remainder` is empty. |
| 2318 | """ |
| 2319 | multiples = (divisor,) * (total // divisor) |
| 2320 | remainder = (total % divisor,) if total % divisor else () |
| 2321 | return multiples, remainder |
| 2322 | |
| 2323 | |
| 2324 | def aligned_coarsen_chunks(chunks: list[int], multiple: int) -> tuple[int, ...]: |
no outgoing calls
no test coverage detected