<s> """<STR_LIT>""" <EOL> import re <EOL> import borg <EOL> logger = borg . get_logger ( __name__ ) <EOL> def parse_sat_output ( stdout ) : <EOL> """<STR_LIT>""" <EOL> match = re . search ( r"<STR_LIT>" , stdout , re . M ) <EOL> if match : <EOL> ( answer_type , ) = map ( str . upper , match . groups ( ) ) <EOL> if answer_type == "<STR_LIT>" : <EOL> answer = [ ] <EOL> for line in re . findall ( r"<STR_LIT>" , stdout , re . M ) : <EOL> answer . extend ( map ( int , line . split ( ) ) ) <EOL> if answer [ - <NUM_LIT:1> ] == <NUM_LIT:0> : <EOL> return answer [ : - <NUM_LIT:1> ] <EOL> elif answer_type == "<STR_LIT>" : <EOL> return False <EOL> return None <EOL> class SAT_SolverFactory ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , root , command , library_paths = ( ) ) : <EOL> """<STR_LIT>""" <EOL> self . _root = root <EOL> self . _command = command <EOL> def __call__ ( self , task , stm_queue = None , solver_id = None ) : <EOL> return borg . solver_io . RunningSolver ( <EOL> parse_sat_output , <EOL> self . _command , <EOL> self . _root , <EOL> task . path , <EOL> stm_queue = stm_queue , <EOL> solver_id = solver_id , <EOL> ) </s>
