code: def test_docwriter_two():
      field = fields.TEXT(stored=True)
      st, codec, seg = _make_codec()
      dw = codec.per_document_writer(st, seg)
      dw.start_doc(0)
      dw.add_field("title", field, ("a", "b"), 2)
      dw.add_field("text", field, "Testing one two three", 4)
      dw.finish_doc()
      dw.start_doc(1)
      dw.add_field("title", field, "The second document", 3)
      dw.add_field("text", field, 500, 1)
      dw.finish_doc()
      dw.close()
      seg.set_doc_count(2)
  
      pdr = codec.per_document_reader(st, seg)
      assert pdr.doc_field_length(0, "title") == 2
      assert pdr.doc_field_length(0, "text") == 4
      assert pdr.doc_field_length(1, "title") == 3
      assert pdr.doc_field_length(1, "text") == 1
  
      assert pdr.stored_fields(0) == {
          "title": ("a", "b"),
          "text": "Testing one two three",
      }
      assert pdr.stored_fields(1) == {
          "title": "The second document",
          "text": 500,
      }
  
imports: from __future__ import with_statement
  import random
  from array import array
  import pytest
  from whoosh import analysis, fields, formats, query
  from whoosh.compat import u, b, text_type
  from whoosh.compat import array_tobytes, xrange
  from whoosh.codec import default_codec
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempStorage
label_desc: Use image node_id 7 for calling a global function with example usage: test_docwriter_two() without return types