@@ -131,14 +131,14 @@ def serialize_q2(country_sets, post_day_ranges):
131
131
for country_set , count_country in country_sets :
132
132
for day_range , count_post in post_day_ranges :
133
133
if random .randint (0 ,len (country_sets ) + len (post_day_ranges )) == 0 :
134
- writer .append ([str (day_range [0 ]), str (day_range [1 ]), ", " .join (country_set ), str (format_date (END_DATE ))], [count_post ,count_post ,count_country ,333 ])
134
+ writer .append ([str (day_range [0 ]), str (day_range [1 ]), "; " .join (country_set ), str (format_date (END_DATE ))], [count_post ,count_post ,count_country ,333 ])
135
135
136
136
def serialize_q3 (post_months ):
137
- writer = ParamsWriter ("q3" , ["todo1 " ,"todo2 " ])
137
+ writer = ParamsWriter ("q3" , ["range1Start " ,"range1End" , "range2Start" , "range2End " ])
138
138
for ix in range (0 ,len (post_months )):
139
139
week_range_a , count_a = post_months [ix ]
140
140
for week_range_b , count_b in post_months [ix + 1 :]:
141
- writer .append ([str (week_range_a ),str (week_range_b )], [count_a ,count_b ])
141
+ writer .append ([str (week_range_a [ 0 ] ),str (week_range_a [ 1 ]), str ( week_range_b [ 0 ]), str ( week_range_b [ 1 ] )], [count_a ,count_b ])
142
142
143
143
def serialize_q4 (tagclasses , countries ):
144
144
writer = ParamsWriter ("q4" , ["tagClass" ,"country" ])
@@ -179,6 +179,9 @@ def serialize_q10(tags):
179
179
for tag , count in tags :
180
180
writer .append ([tag ], [count ])
181
181
182
+ def serialize_q11 ():
183
+ writer = ParamsWriter ("q11" , ["country" , "blacklist" ])
184
+
182
185
def serialize_q12 (post_weeks ):
183
186
writer = ParamsWriter ("q12" , ["creationDate" , "likeCount" ])
184
187
for week , count in post_weeks :
@@ -222,6 +225,9 @@ def serialize_q19(tagclasses):
222
225
for tag_class_b , count_b in tagclasses [ix + 1 :]:
223
226
writer .append ([str ("1989-1-1" ),tag_class_a , tag_class_b ], [count_a , count_b ])
224
227
228
+ def serialize_q20 ():
229
+ writer = ParamsWriter ("q20" , [])
230
+
225
231
def serialize_q21 (countries ):
226
232
writer = ParamsWriter ("q21" , ["country" ,"endDate" ])
227
233
for country , count in countries :
@@ -346,5 +352,8 @@ def main(argv=None):
346
352
serialize_q23 (key_params (country_sample , total_posts / 200 , total_posts / 100 ))
347
353
serialize_q24 (key_params (tagclass_posts , total_posts / 140 , total_posts / 5 ))
348
354
355
+ serialize_q11 ()
356
+ serialize_q20 ()
357
+
349
358
if __name__ == "__main__" :
350
359
sys .exit (main ())
0 commit comments