#NEWLINE# def __and__( self , other ) : #NEWLINE# #INDENT# " Intersection is the minimum of corresponding counts.\n\n        >>> Counter('abbb') & Counter('bcc')\n        Counter({'b': 1})\n\n        " #NEWLINE# if ( not isinstance ( other , Counter ) ) : #NEWLINE# #INDENT# return NotImplemented #NEWLINE# #UNINDENT# result = Counter ( ) #NEWLINE# for ( elem , count ) in self . items ( ) : #NEWLINE# #INDENT# other_count = other [ elem ] #NEWLINE# newcount = ( count if ( count < other_count ) else other_count ) #NEWLINE# if ( newcount > 0 ) : #NEWLINE# #INDENT# result [ elem ] = newcount #NEWLINE# #UNINDENT# #UNINDENT# return result