<s> import os <EOL> import judger <EOL> WA = <NUM_LIT:1> <EOL> AC = <NUM_LIT:0> <EOL> SPJ_ERROR = - <NUM_LIT:1> <EOL> def file_exists ( path ) : <EOL> return os . path . exists ( path ) <EOL> def spj ( path , max_cpu_time , max_memory , in_path , user_out_path ) : <EOL> if file_exists ( in_path ) and file_exists ( user_out_path ) : <EOL> result = judger . run ( path = path , in_file = in_path , out_file = "<STR_LIT>" , <EOL> max_cpu_time = max_cpu_time , max_memory = max_memory , <EOL> args = [ in_path , user_out_path ] , env = [ "<STR_LIT>" + os . environ . get ( "<STR_LIT>" , "<STR_LIT>" ) ] , <EOL> use_sandbox = True , use_nobody = True ) <EOL> if result [ "<STR_LIT>" ] == <NUM_LIT:0> and result [ "<STR_LIT>" ] in [ AC , WA , SPJ_ERROR ] : <EOL> result [ "<STR_LIT>" ] = result [ "<STR_LIT>" ] <EOL> else : <EOL> result [ "<STR_LIT>" ] = SPJ_ERROR <EOL> return result <EOL> else : <EOL> raise ValueError ( "<STR_LIT>" ) </s>
