def merge_similar_guesses(guesses, prop, choose):
 similar = [guess for guess in guesses if (prop in guess)]
 if (len(similar) < 2):
  return
 if (len(similar) == 2):
  _merge_similar_guesses_nocheck(guesses, prop, choose)
 if (len(similar) > 2):
  log.debug(u'complex merge, trying our best...')
  before = len(guesses)
  _merge_similar_guesses_nocheck(guesses, prop, choose)
  after = len(guesses)
  if (after < before):
   merge_similar_guesses(guesses, prop, choose)

def merge_similar_guesses ( guesses , prop , choose ) : similar = [ guess for guess in guesses if ( prop in guess ) ] if ( len ( similar ) < 2 ) : return if ( len ( similar ) == 2 ) : _merge_similar_guesses_nocheck ( guesses , prop , choose ) if ( len ( similar ) > 2 ) : log . debug ( u'complex merge, trying our best...' ) before = len ( guesses ) _merge_similar_guesses_nocheck ( guesses , prop , choose ) after = len ( guesses ) if ( after < before ) : merge_similar_guesses ( guesses , prop , choose )
take a list of guesses and merge those which have the same properties .