Backs off on each failure and spreads retries out, so a recovering service is not hit by every client at once.
Language
Snippets written in Python
Iterating a file object yields one line at a time, which is the difference between a constant footprint and an OOM.
itertools.batched on 3.12 and later; the islice version works everywhere and never materialises the whole input.
__post_init__ runs after the generated constructor, which is where cheap invariants belong.
A context manager that prints how long its body took, without scattering time.perf_counter calls through the function.
argparse covers subcommands, types and help text, which is more than most scripts ever need.
The | operator returns a new dict; |= updates in place. Later keys win in both.
pathlib keeps the paths as objects rather than strings, so joining and suffix checks stay readable.
One test body, many cases, and a failure that names the case that broke.