code: def test_query_terms():
      qp = QueryParser("a", None)
  
      q = qp.parse("alfa b:(bravo OR c:charlie) delta")
      assert sorted(q.iter_all_terms()) == [
          ("a", "alfa"),
          ("a", "delta"),
          ("b", "bravo"),
          ("c", "charlie"),
      ]
  
      q = qp.parse("alfa brav*")
      assert sorted(q.iter_all_terms()) == [("a", "alfa")]
  
      q = qp.parse('a b:("b c" d)^2 e')
      tokens = [(t.fieldname, t.text, t.boost) for t in q.all_tokens()]
      assert tokens == [
          ("a", "a", 1.0),
          ("b", "b", 2.0),
          ("b", "c", 2.0),
          ("b", "d", 2.0),
          ("a", "e", 1.0),
      ]
  
imports: from __future__ import with_statement
  import gzip
  from whoosh import analysis, fields, highlight, query, spelling
  from whoosh.compat import u
  from whoosh.qparser import QueryParser
  from whoosh.support.levenshtein import levenshtein
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 7 for calling a global function with example usage: test_query_terms() without return types