code: def test_fieldwriter_multiblock():
      field = fields.TEXT()
      st, codec, seg = _make_codec(blocklimit=2)
  
      fw = codec.field_writer(st, seg)
      fw.start_field("text", field)
      fw.start_term(b("alfa"))
      fw.add(0, 2.0, b("test1"), 2)
      fw.add(1, 5.0, b("test2"), 5)
      fw.add(2, 3.0, b("test3"), 3)
      fw.add(3, 4.0, b("test4"), 4)
      fw.add(4, 1.0, b("test5"), 1)
      fw.finish_term()
      fw.finish_field()
      fw.close()
  
      tr = codec.terms_reader(st, seg)
      ti = tr.term_info("text", b("alfa"))
      assert ti.weight() == 15.0
      assert ti.doc_frequency() == 5
      assert ti.min_length() == 1
      assert ti.max_length() == 5
      assert ti.max_weight() == 5.0
      assert ti.min_id() == 0
      assert ti.max_id() == 4
  
      ps = []
      m = tr.matcher("text", b("alfa"), field.format)
      while m.is_active():
          ps.append((m.id(), m.weight(), m.value()))
          m.next()
      assert ps == [
          (0, 2.0, b("test1")),
          (1, 5.0, b("test2")),
          (2, 3.0, b("test3")),
          (3, 4.0, b("test4")),
          (4, 1.0, b("test5")),
      ]
  
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 14 for calling a global function with example usage: test_fieldwriter_multiblock() without return types