Factor-out the common code for setting a KeyError.
Minor touchups.
Fix docstring and some indentation
Remove unused --debug option of regrtest.

If bots fail due to using this flag, the buildbot scripts have to be modified
to omit it. Regrtest ignores it anyway.
Issue #18912: Fix indentation in docstring

Contributed by Jeroen Van Goey
Issue #18912: Fix indentation in docstring

Contributed by Jeroen Van Goey
cwr_next():  move invariants out of loops.

This simplifies and clarifies the code, and gives a small speedup.
Merge 3.3 into default.

cwr_next():  move invariants out of loops.

This simplifies and clarifies the code, and gives a small speedup.
Issue #17487: The result of the wave getparams method now is pickleable again.
Patch by Claudiu Popa.
Issue #18901: The sunau getparams method now returns a namedtuple rather than
a plain tuple.  Patch by Claudiu Popa.