code: def test_posboost_postings():
      pbs = PositionBoosts()
      ana = (
          analysis.RegexTokenizer(r"\S+")
          | analysis.DelimitedAttributeFilter()
      )
      content = u("alfa^2 bravo^0.1 charlie^2 bravo^0.5 alfa alfa")
      assert _roundtrip(content, pbs, "position_boosts", ana) == [
          ("alfa", [(0, 2), (4, 1), (5, 1)]),
          ("bravo", [(1, 0.1), (3, 0.5)]),
          ("charlie", [(2, 2)]),
      ]
      assert _roundtrip(content, pbs, "positions", ana) == [
          ("alfa", [0, 4, 5]),
          ("bravo", [1, 3]),
          ("charlie", [2]),
      ]
      assert _roundtrip(content, pbs, "frequency", ana) == [
          ("alfa", 3),
          ("bravo", 2),
          ("charlie", 1),
      ]
  
file_path: whoosh/tests/test_postings.py
imports: from __future__ import with_statement
  from whoosh import analysis, fields
  from whoosh.compat import u
  from whoosh.codec import default_codec
  from whoosh.formats import Existence, Frequency
  from whoosh.formats import Positions, PositionBoosts
  from whoosh.formats import Characters, CharacterBoosts
  from whoosh.util.testing import TempStorage
label_desc: Use image node_id 6 for calling a global function with example usage: test_posboost_postings() without return types