code: def write_file(
      vlsp_include_spaces, output_filename, sentences, shard
  ):
      with open(output_filename, "w") as fout:
          check_headlines = False
          for sent_idx, sentence in enumerate(sentences):
              fout.write("# sent_id = %s.%d\n" % (shard, sent_idx))
              orig_text = " ".join(sentence)
              # check if the previous line is a headline (no ending mark at the end) then make this sentence a new par
              if check_headlines:
                  fout.write(
                      "# newpar id =%s.%d.1\n" % (shard, sent_idx)
                  )
                  check_headlines = False
              if sentence[len(sentence) - 1] not in punctuation_set:
                  check_headlines = True
  
              if vlsp_include_spaces:
                  fout.write("# text = %s\n" % orig_text)
              else:
                  spaces = find_spaces(sentence)
                  full_text = ""
                  for word, space in zip(sentence, spaces):
                      # could be made more efficient, but shouldn't matter
                      full_text = full_text + word
                      if space:
                          full_text = full_text + " "
                  fout.write("# text = %s\n" % full_text)
                  fout.write("# orig_text = %s\n" % orig_text)
              for word_idx, word in enumerate(sentence):
                  fake_dep = "root" if word_idx == 0 else "dep"
                  fout.write(
                      "%d\t%s\t%s" % ((word_idx + 1), word, word)
                  )
                  fout.write("\t_\t_\t_")
                  fout.write("\t%d\t%s" % (word_idx, fake_dep))
                  fout.write("\t_\t")
                  if vlsp_include_spaces or spaces[word_idx]:
                      fout.write("_")
                  else:
                      fout.write("SpaceAfter=No")
                  fout.write("\n")
              fout.write("\n")
  
imports: import os
label_desc: Use image node_id 3 for calling a global function with example usage: write_file(vlsp_include_spaces, output_filename, sentences, shard) without return types