<s> from combinator import Combinator <EOL> from biicode . common . utils . bii_logging import logger <EOL> import itertools <EOL> class CompatibilityAnalyzer ( object ) : <EOL> def __init__ ( self , store , authUser ) : <EOL> self . __store = store <EOL> self . __authUser = authUser <EOL> def jointCompatibility ( self , combination ) : <EOL> return all ( [ e1 . is_compatible ( e2 ) for e1 , e2 in itertools . combinations ( combination , <NUM_LIT:2> ) ] ) <EOL> def solve ( self , hypothesis ) : <EOL> combinator = Combinator ( hypothesis ) <EOL> while True : <EOL> combination = combinator . getNext ( ) <EOL> if any ( c . invalid for c in combination ) : <EOL> break <EOL> if not combination : <EOL> break <EOL> if self . jointCompatibility ( combination ) : <EOL> logger . debug ( "<STR_LIT>" , combination ) <EOL> return combination </s>
