 '''<STR_LIT>''' <EOL> import csv <EOL> import sys <EOL> import random <EOL> input_file = sys . argv [ <NUM_LIT:1> ] <EOL> output_file1 = sys . argv [ <NUM_LIT:2> ] <EOL> output_file2 = sys . argv [ <NUM_LIT:3> ] <EOL> try : <EOL> P = float ( sys . argv [ <NUM_LIT:4> ] ) <EOL> except IndexError : 
 P = <NUM_LIT> 
 '''<STR_LIT>''' <EOL> import csv <EOL> import sys <EOL> import random <EOL> input_file = sys . argv [ <NUM_LIT:1> ] <EOL> output_file1 = sys . argv [ <NUM_LIT:2> ] <EOL> output_file2 = sys . argv [ <NUM_LIT:3> ] <EOL> try : <EOL> P = float ( sys . argv [ <NUM_LIT:4> ] ) <EOL> except IndexError : <EOL> P = <NUM_LIT> <EOL> try : <EOL> seed = sys . argv [ <NUM_LIT:5> ] <EOL> except IndexError : <EOL> seed = None <EOL> try : <EOL> skip_headers = sys . argv [ <NUM_LIT:6> ] <EOL> except IndexError : <EOL> skip_headers = False <EOL> try : <EOL> skip_headers = sys . argv [ <NUM_LIT:6> ] <EOL> except IndexError : <EOL> skip_headers = False <EOL> print "<STR_LIT>" % ( P ) <EOL> if seed : <EOL> random . seed ( seed ) <EOL> i = open ( input_file ) <EOL> o1 = open ( output_file1 , '<STR_LIT:wb>' ) <EOL> o2 = open ( output_file2 , '<STR_LIT:wb>' ) <EOL> if skip_headers : <EOL> i . readline ( ) <EOL> counter = <NUM_LIT:0> <EOL> for line in i : <EOL> r = random . random ( ) <EOL> if r > P : <EOL> o2 . write ( line ) <EOL> else : <EOL> o1 . write ( line ) <EOL> counter += <NUM_LIT:1> <EOL> if counter % <NUM_LIT> == <NUM_LIT:0> : <EOL> print counter </s>
