#NEWLINE# def count_badges( self , user , badgeiter ) : #NEWLINE# #INDENT# user . bronce_badges = user . silver_badges = user . gold_badges = user . platin_badges = 0 #NEWLINE# for badge in badgeiter : #NEWLINE# #INDENT# if badge : #NEWLINE# #INDENT# attr = ( badge . level + '_badges' ) #NEWLINE# setattr ( user , attr , ( getattr ( user , attr , 0 ) + 1 ) )