code: def test_frequency_text():
      s = fields.Schema(content=fields.KEYWORD)
      st = RamStorage()
      ix = st.create_index(s)
  
      w = ix.writer()
      w.add_document(content=u("alfa bravo charlie delta echo"))
      w.add_document(
          content=u("bravo bravo bravo bravo charlie delta delta")
      )
      w.add_document(content=u("delta echo foxtrot"))
      w.commit()
  
      with ix.reader() as tr:
          assert tr.doc_frequency("content", u("bravo")) == 2
          assert tr.frequency("content", u("bravo")) == 5
          assert tr.doc_frequency("content", u("echo")) == 2
          assert tr.frequency("content", u("echo")) == 2
          assert tr.doc_frequency("content", u("alfa")) == 1
          assert tr.frequency("content", u("alfa")) == 1
          assert tr.doc_frequency("content", u("delta")) == 3
          assert tr.frequency("content", u("delta")) == 4
          assert tr.doc_frequency("content", u("foxtrot")) == 1
          assert tr.frequency("content", u("foxtrot")) == 1
          assert tr.doc_frequency("content", u("zulu")) == 0
          assert tr.frequency("content", u("zulu")) == 0
  
          stats = [
              (fname, text, ti.doc_frequency(), ti.weight())
              for (fname, text), ti in tr
          ]
  
          assert stats == [
              ("content", b("alfa"), 1, 1),
              ("content", b("bravo"), 2, 5),
              ("content", b("charlie"), 2, 2),
              ("content", b("delta"), 3, 4),
              ("content", b("echo"), 2, 2),
              ("content", b("foxtrot"), 1, 1),
          ]
  
imports: from __future__ import with_statement
  import random
  from collections import defaultdict
  from datetime import datetime
  import pytest
  from whoosh import analysis, fields, index, qparser, query, __version__
  from whoosh.compat import b, u, xrange, text_type, permutations
  from whoosh.filedb.filestore import RamStorage
  from whoosh.writing import IndexingError
  from whoosh.util.numeric import length_to_byte, byte_to_length
  from whoosh.util.testing import TempIndex, TempStorage
label_desc: Use image node_id 11 for calling a global function with example usage: test_frequency_text() without return types