STYLE: enable pylint warnings for `cell-var-from-loop`
- [x] addresses pylint issues with `cell-var-from-loop` as part of general pylint efforts in  #48855 

- Found one instance of the error that was an easy lift of function outside a loop
- Refactored two other locations for error based on tips from @mroeschke 

TIL `functools.partial` is a thing.


> almost there 💪

The reward for a steep climb is the view from the top. 