def write(filepath, rows):
  """Write a List of Dicts to jsonl file."""
  with gfile.GFile(filepath, "w") as jsonl_file:
    for row in rows:
      line = "%s\n" % json.dumps(row)
      jsonl_file.write(line)
  print("Wrote %s lines to %s." % (len(rows), filepath))
Write a List of Dicts to jsonl file.
language/quest/common/jsonl_utils.py