code: def test_write_russian_doc(tmp_path):
      """
      Specifically test the write_doc2conll method
      """
      filename = tmp_path / "russian.conll"
      doc = CoNLL.conll2doc(input_str=RUSSIAN_SAMPLE)
      check_russian_doc(doc)
      CoNLL.write_doc2conll(doc, filename)
  
      with open(filename, encoding="utf-8") as fin:
          text = fin.read()
  
      # the conll docs have to end with \n\n
      assert text.endswith("\n\n")
  
      # but to compare against the original, strip off the whitespace
      text = text.strip()
  
      # we skip the first sentence because the "deprel=list:goeswith" is weird
      # note that the deprel itself is checked in check_russian_doc
      text = text[text.find("# sent_id = 4") :]
      sample = RUSSIAN_SAMPLE[RUSSIAN_SAMPLE.find("# sent_id = 4") :]
      assert text == sample
  
      doc2 = CoNLL.conll2doc(filename)
      check_russian_doc(doc2)
  
imports: import io
  import pytest
  import tempfile
  from zipfile import ZipFile
  import stanza
  from stanza.utils.conll import CoNLL
  from stanza.models.common.doc import Document
  from stanza.tests import *
label_desc: Use image node_id 5 for calling a global function with example usage: test_write_russian_doc(tmp_path) without return types