<s> """<STR_LIT>""" <EOL> import sys <EOL> import csv <EOL> input_file = sys . argv [ <NUM_LIT:1> ] <EOL> output_file = sys . argv [ <NUM_LIT:2> ] <EOL> d = int ( sys . argv [ <NUM_LIT:3> ] ) <EOL> assert ( d > <NUM_LIT:0> ) <EOL> reader = csv . reader ( open ( input_file ) , delimiter = "<STR_LIT:U+0020>" ) <EOL> writer = csv . writer ( open ( output_file , '<STR_LIT:wb>' ) ) <EOL> for line in reader : <EOL> label = line . pop ( <NUM_LIT:0> ) <EOL> if line [ - <NUM_LIT:1> ] . strip ( ) == '<STR_LIT>' : <EOL> line . pop ( - <NUM_LIT:1> ) <EOL> line = map ( lambda x : tuple ( x . split ( "<STR_LIT::>" ) ) , line ) <EOL> new_line = [ label ] + [ <NUM_LIT:0> ] * d <EOL> for i , v in line : <EOL> i = int ( i ) <EOL> if i <= d : <EOL> new_line [ i ] = v <EOL> writer . writerow ( new_line ) </s>
