<s> import time <EOL> from SevenEval import SevenEval <EOL> from FiveEval import FiveEval <EOL> import random <EOL> def setup ( n , m ) : <EOL> hands = [ ] <EOL> boards = [ ] <EOL> for i in range ( n ) : <EOL> deck = range ( <NUM_LIT> ) <EOL> random . shuffle ( deck ) <EOL> hand = [ ] <EOL> board = [ ] <EOL> for j in range ( <NUM_LIT:2> ) : <EOL> hand . append ( deck . pop ( <NUM_LIT:0> ) ) <EOL> for j in range ( m ) : <EOL> board . append ( deck . pop ( <NUM_LIT:0> ) ) <EOL> hands . append ( hand ) <EOL> boards . append ( board ) <EOL> return boards , hands <EOL> s = SevenEval ( ) <EOL> N = <NUM_LIT> <EOL> cumtime = <NUM_LIT:0.0> <EOL> boards , hands = setup ( N , <NUM_LIT:5> ) <EOL> for i in range ( len ( boards ) ) : <EOL> start = time . time ( ) <EOL> s . getRankOfSeven ( * ( boards [ i ] + hands [ i ] ) ) <EOL> cumtime += ( time . time ( ) - start ) <EOL> avg = float ( cumtime / N ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % avg <EOL> print "<STR_LIT>" % ( <NUM_LIT:1.0> / avg ) <EOL> f = FiveEval ( ) <EOL> cumtime = <NUM_LIT:0.0> <EOL> boards , hands = setup ( N , <NUM_LIT:3> ) <EOL> for i in range ( len ( boards ) ) : <EOL> start = time . time ( ) <EOL> f . getRankOfFive ( * ( boards [ i ] + hands [ i ] ) ) <EOL> cumtime += ( time . time ( ) - start ) <EOL> avg = float ( cumtime / N ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % avg <EOL> print "<STR_LIT>" % ( <NUM_LIT:1.0> / avg ) </s>
