<s> import os <EOL> import sys <EOL> import subprocess <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> if len ( sys . argv ) < <NUM_LIT:3> : <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" + sys . argv [ <NUM_LIT:0> ] + "<STR_LIT>" ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> lname = sys . argv [ <NUM_LIT:1> ] <EOL> sname = sys . argv [ <NUM_LIT:2> ] <EOL> if not os . path . isfile ( lname ) : <EOL> print ( "<STR_LIT>" + lname + "<STR_LIT>" ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> if not os . path . isfile ( sname ) : <EOL> print ( "<STR_LIT>" + sname + "<STR_LIT>" ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> sdict = dict ( ) <EOL> sfd = open ( sname , '<STR_LIT:r>' ) <EOL> lines = sfd . readlines ( ) <EOL> for line in lines : <EOL> pageid , score = line . strip ( '<STR_LIT:\n>' ) . split ( '<STR_LIT:\t>' ) <EOL> sdict [ pageid ] = score <EOL> fd = open ( lname , '<STR_LIT:r>' ) <EOL> lines = fd . readlines ( ) <EOL> for line in lines : <EOL> words = line . strip ( '<STR_LIT:\n>' ) . split ( '<STR_LIT:U+0020>' ) <EOL> pageid = words [ <NUM_LIT:0> ] [ : len ( words [ <NUM_LIT:0> ] ) - <NUM_LIT:1> ] <EOL> for page in words [ <NUM_LIT:1> : ] : <EOL> print ( "<STR_LIT>" % ( page , float ( sdict [ pageid ] ) / ( len ( words ) - <NUM_LIT:1> ) ) ) </s>
