code: def test_vector_values():
      field = fields.TEXT(vector=formats.Frequency())
      st, codec, seg = _make_codec()
      content = u("alfa bravo charlie alfa")
  
      dw = codec.per_document_writer(st, seg)
      dw.start_doc(0)
      vals = (
          (t, w, v)
          for t, _, w, v in sorted(
              field.vector.word_values(content, field.analyzer)
          )
      )
      dw.add_vector_items("f1", field, vals)
      dw.finish_doc()
      dw.close()
  
      vr = codec.per_document_reader(st, seg)
      m = vr.vector(0, "f1", field.vector)
      assert list(m.items_as("frequency")) == [
          ("alfa", 2),
          ("bravo", 1),
          ("charlie", 1),
      ]
  
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 9 for calling a global function with example usage: test_vector_values() without return types