Creates a canvas to calculate: n * sum(1..n) * 10 For example, if n = 3, the result is 3 * (1 + 2 + 3) * 10 = 180
(n: int)
| 8 | |
| 9 | |
| 10 | def create_canvas(n: int) -> Signature: |
| 11 | """Creates a canvas to calculate: n * sum(1..n) * 10 |
| 12 | For example, if n = 3, the result is 3 * (1 + 2 + 3) * 10 = 180 |
| 13 | """ |
| 14 | canvas = chain( |
| 15 | group(identity_task.s(i) for i in range(1, n+1)) | xsum.s(), |
| 16 | chord(group(mul.s(10) for _ in range(1, n+1)), xsum.s()), |
| 17 | ) |
| 18 | |
| 19 | return canvas |
| 20 | |
| 21 | |
| 22 | def revoke_by_headers(result: AsyncResult, terminate: bool) -> None: |
no test coverage detected