Generate: contrastive search cosmetic tweaks
# What does this PR do?

Makes some cosmetic tweaks to contrastive search in advance of the TF PR:
- fixes some documentation strings out of place;
- correct type hints;
- limits comments to 120 chars;
- removes redundant variables.

Changes validated against the slow tests for contrastive search.
_The documentation is not available anymore as the PR was closed or merged._