CLN: Fix many indentation errors found in #6643.
Changes should only affect whitespace.

closes #6643

@dsm054 can you rebase (and remove the sql stuff)...then can merge
 @dsm054 can you rebase this....
 @dsm054 want to rebase this?
 Okay, this is the next one up.
 ok make a one liner for that elif change pls
