def write_data_file(dat_filename, stats):
  ''' Write out the datapoints '''
  sorted_keys = stats["iteration_size"].keys()
  sorted_keys.sort(lambda a,b: -1 if int (b) < int(a) else 1 if int(a) > int(b) else 0)
  with open(dat_filename, "w") as dat:
    for key in sorted_keys:
      dat.write(str(key) + " " + str(stats["iteration_size"][key]) + '\n')
dataset/ETHPy150Open ucb-sts/sts/runtime_stats/generate_graph.py/write_data_file/swapped operands of `<`