enable F402 check for flake8

The change removes the shadowed loop variables and enables F402 checking

Change-Id: I015797feec463ffb0b5e97229a6ec2c9a41df9de
Partial-Bug: 1329017
Merge "enable F402 check for flake8"