#NEWLINE# def sample( cp , temp , count , seed = None , ident = 'output' ) : #NEWLINE# #INDENT# if ( seed is None ) : #NEWLINE# #INDENT# seed = random . randint ( ( - 1000000000 ) , 1000000000 ) #NEWLINE# #UNINDENT# outfile = ( ( ( ( ( cp + '.' ) + ident ) + '.' ) + str ( temp ) ) + '.txt' ) #NEWLINE# cmd = ( ( ( ( ( ( ( ( ( 'th sample.lua ' + cp ) + ' -temperature ' ) + str ( temp ) ) + ' -length ' ) + str ( count ) ) + ' -seed ' ) + str ( seed ) ) + ' >> ' ) + outfile ) #NEWLINE# if os . path . exists ( outfile ) : #NEWLINE# #INDENT# print ( ( outfile + ' already exists, skipping' ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# subprocess . call ( ( ( ( 'echo "' + cmd ) + '" | tee ' ) + outfile ) , shell = True ) #NEWLINE# subprocess . call ( ident , shell = True )