import sys

in_path = sys.argv[1]
out_path = sys.argv[2]

with open(in_path) as f_in:
    with open(out_path, 'w') as f_out:
        for line in f_out:
            arr = line.split(" ")
            label = int(arr[1])
            feature_ids = arr[2:]
            f_out.write(str(label) + " " + " ".join(map(lambda s: s + ":1", feature_ids)))

@@ -140,19 +140,18 @@
 ne in f_
-out
+in
 :%0A      
@@ -167,16 +167,24 @@
  = line.
+strip().
 split(%22 
@@ -341,10 +341,17 @@
 re_ids))
+ + %22%5Cn%22
 )%0A

fix bugs