edit changes to limit resources
Fix pep8

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit 1060997bcd40282656503a15191abd1814bfe064)