<s> import os <EOL> import signal <EOL> import subprocess <EOL> import sys <EOL> import time <EOL> import urllib2 <EOL> EXTRA_PATH = os . path . dirname ( os . path . abspath ( __file__ ) ) + "<STR_LIT>" <EOL> sys . path . insert ( <NUM_LIT:0> , EXTRA_PATH ) <EOL> from django . core . management import execute_from_command_line <EOL> import os <EOL> import shutil <EOL> is_pyston = True <EOL> if is_pyston : <EOL> ARGS = "<STR_LIT>" <EOL> else : <EOL> ARGS = "<STR_LIT>" <EOL> if os . path . exists ( "<STR_LIT>" ) : <EOL> print "<STR_LIT>" <EOL> shutil . rmtree ( "<STR_LIT>" ) <EOL> try : <EOL> sys . argv += [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> print "<STR_LIT>" <EOL> r = execute_from_command_line ( ) <EOL> assert not r <EOL> print "<STR_LIT>" <EOL> env = dict ( os . environ ) <EOL> env [ "<STR_LIT>" ] = env . get ( "<STR_LIT>" , "<STR_LIT>" ) + "<STR_LIT::>" + EXTRA_PATH <EOL> subprocess . check_call ( [ sys . executable , ARGS , "<STR_LIT>" , "<STR_LIT>" ] , env = env ) <EOL> print "<STR_LIT>" <EOL> p = subprocess . Popen ( [ sys . executable , ARGS , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] , stdout = subprocess . PIPE , env = env ) <EOL> try : <EOL> print "<STR_LIT>" <EOL> while True : <EOL> l = p . stdout . readline ( ) <EOL> assert l , "<STR_LIT>" <EOL> print l <EOL> if l . startswith ( "<STR_LIT>" ) : <EOL> break <EOL> time . sleep ( <NUM_LIT:1> ) <EOL> print "<STR_LIT>" <EOL> f = urllib2 . urlopen ( "<STR_LIT>" , timeout = <NUM_LIT:1> ) <EOL> s = f . read ( ) <EOL> assert "<STR_LIT>" in s <EOL> print "<STR_LIT>" <EOL> p . send_signal ( signal . SIGINT ) <EOL> while True : <EOL> l = p . stdout . readline ( ) <EOL> if not l : <EOL> break <EOL> assert "<STR_LIT>" not in l , l <EOL> print l <EOL> code = p . wait ( ) <EOL> except : <EOL> p . kill ( ) <EOL> p . wait ( ) <EOL> raise <EOL> finally : <EOL> pass <EOL> print <EOL> print "<STR_LIT>" </s>
