<s> import sys <EOL> import os <EOL> if not len ( sys . argv ) == <NUM_LIT:2> : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> cwd = os . getcwd ( ) <EOL> fname = sys . argv [ <NUM_LIT:1> ] <EOL> ftmp = sys . argv [ <NUM_LIT:1> ] + "<STR_LIT>" <EOL> print "<STR_LIT:%s>" % fname <EOL> with open ( fname ) as dfile : <EOL> with open ( ftmp , "<STR_LIT:w>" ) as tmp : <EOL> ref , query = dfile . readline ( ) . split ( ) <EOL> new_ref = os . path . join ( cwd , os . path . basename ( ref ) ) <EOL> tmp . write ( "<STR_LIT:U+0020>" . join ( [ new_ref , query ] ) + "<STR_LIT:\n>" ) <EOL> for line in dfile : <EOL> tmp . write ( line ) <EOL> os . rename ( ftmp , fname ) </s>
