def _common_bytes(blocks1, blocks2):
 if (len(blocks1) > len(blocks2)):
  (blocks1, blocks2) = (blocks2, blocks1)
 score = 0
 for (block, count1) in blocks1.items():
  count2 = blocks2.get(block)
  if count2:
   score += min(count1, count2)
 return score

def _common_bytes ( blocks1 , blocks2 ) : if ( len ( blocks1 ) > len ( blocks2 ) ) : ( blocks1 , blocks2 ) = ( blocks2 , blocks1 ) score = 0 for ( block , count1 ) in blocks1 . items ( ) : count2 = blocks2 . get ( block ) if count2 : score += min ( count1 , count2 ) return score
count the number of common bytes in two block count dicts .