<s> class Counter ( dict ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , iterable = None , ** kwds ) : <EOL> '''<STR_LIT>''' <EOL> self . update ( iterable , ** kwds ) <EOL> def update ( self , iterable = None , ** kwds ) : <EOL> '''<STR_LIT>''' <EOL> if iterable is not None : <EOL> if hasattr ( iterable , '<STR_LIT>' ) : <EOL> if self : <EOL> self_get = self . get <EOL> for elem , count in iterable . iteritems ( ) : <EOL> self [ elem ] = self_get ( elem , <NUM_LIT:0> ) + count <EOL> else : <EOL> dict . update ( self , iterable ) <EOL> else : <EOL> self_get = self . get <EOL> for elem in iterable : <EOL> self [ elem ] = self_get ( elem , <NUM_LIT:0> ) + <NUM_LIT:1> <EOL> if kwds : <EOL> self . update ( kwds ) </s>
