#NEWLINE# def end_any( self , item ) : #NEWLINE# #INDENT# if ( not ( 'counted' in item . attribs ) ) : #NEWLINE# #INDENT# item . attribs [ 'counted' ] = True #NEWLINE# if ( item . type in self . counts ) : #NEWLINE# #INDENT# self . counts [ item . type ] = ( self . counts [ item . type ] + 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . counts [ item . type ] = 1