<s> import sys <EOL> import os <EOL> import time <EOL> path = '<STR_LIT>' <EOL> sys . path . append ( path ) <EOL> file = open ( path + '<STR_LIT>' , '<STR_LIT:r>' ) <EOL> engines = [ ] <EOL> for engine in file . readlines ( ) : <EOL> engines . append ( engine . rstrip ( ) ) <EOL> file . close ( ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> for engine in engines : <EOL> wins_white = <NUM_LIT:0> <EOL> wins_black = <NUM_LIT:0> <EOL> draws_white = <NUM_LIT:0> <EOL> draws_black = <NUM_LIT:0> <EOL> loss_white = <NUM_LIT:0> <EOL> loss_black = <NUM_LIT:0> <EOL> for i in range ( <NUM_LIT:1> , <NUM_LIT:5> ) : <EOL> log_file = path + "<STR_LIT>" + str ( i ) <EOL> log = open ( log_file ) <EOL> for line in log . readlines ( ) : <EOL> if line . find ( '<STR_LIT>' + engine + '<STR_LIT:U+002C>' ) != - <NUM_LIT:1> : <EOL> if line . find ( '<STR_LIT>' + engine + '<STR_LIT:U+002C>' ) != - <NUM_LIT:1> : <EOL> wins_white += <NUM_LIT:1> <EOL> elif line . find ( '<STR_LIT>' ) != - <NUM_LIT:1> : <EOL> draws_white += <NUM_LIT:1> <EOL> else : <EOL> loss_white += <NUM_LIT:1> <EOL> elif line . find ( '<STR_LIT>' + engine + '<STR_LIT:U+002C>' ) != - <NUM_LIT:1> : <EOL> if line . find ( '<STR_LIT>' + engine + '<STR_LIT:U+002C>' ) != - <NUM_LIT:1> : <EOL> wins_black += <NUM_LIT:1> <EOL> elif line . find ( '<STR_LIT>' ) != - <NUM_LIT:1> : <EOL> draws_black += <NUM_LIT:1> <EOL> else : <EOL> loss_black += <NUM_LIT:1> <EOL> log . close ( ) <EOL> score = wins_white + wins_black + ( draws_white + draws_black ) / <NUM_LIT:2> <EOL> print ( engine + '<STR_LIT>' + str ( score ) + '<STR_LIT:\t>' + str ( wins_white ) + '<STR_LIT:\t>' + str ( wins_black ) + '<STR_LIT:\t>' + str ( draws_white ) + '<STR_LIT:\t>' + str ( draws_black ) + '<STR_LIT:\t>' + str ( loss_white ) + '<STR_LIT:\t>' + str ( loss_black ) ) </s>
