code: def test_charboost_postings():
      cbs = CharacterBoosts()
      ana = (
          analysis.RegexTokenizer(r"\S+")
          | analysis.DelimitedAttributeFilter()
      )
      content = u("alfa^2 bravo^0.1 charlie^2 bravo^0.5 alfa alfa")
      assert _roundtrip(content, cbs, "character_boosts", ana) == [
          ("alfa", [(0, 0, 4, 2), (4, 37, 41, 1), (5, 42, 46, 1)]),
          ("bravo", [(1, 7, 12, 0.1), (3, 27, 32, 0.5)]),
          ("charlie", [(2, 17, 24, 2)]),
      ]
      assert _roundtrip(content, cbs, "position_boosts", ana) == [
          ("alfa", [(0, 2), (4, 1), (5, 1)]),
          ("bravo", [(1, 0.1), (3, 0.5)]),
          ("charlie", [(2, 2)]),
      ]
      assert _roundtrip(content, cbs, "characters", ana) == [
          ("alfa", [(0, 0, 4), (4, 37, 41), (5, 42, 46)]),
          ("bravo", [(1, 7, 12), (3, 27, 32)]),
          ("charlie", [(2, 17, 24)]),
      ]
      assert _roundtrip(content, cbs, "positions", ana) == [
          ("alfa", [0, 4, 5]),
          ("bravo", [1, 3]),
          ("charlie", [2]),
      ]
      assert _roundtrip(content, cbs, "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 7 for calling a global function with example usage: test_charboost_postings() without return types