code: def test_frequency_keyword():
      s = fields.Schema(content=fields.KEYWORD)
      st = RamStorage()
      ix = st.create_index(s)
  
      w = ix.writer()
      w.add_document(content=u("A B C D E"))
      w.add_document(content=u("B B B B C D D"))
      w.add_document(content=u("D E F"))
      w.commit()
  
      with ix.reader() as tr:
          assert tr.doc_frequency("content", u("B")) == 2
          assert tr.frequency("content", u("B")) == 5
          assert tr.doc_frequency("content", u("E")) == 2
          assert tr.frequency("content", u("E")) == 2
          assert tr.doc_frequency("content", u("A")) == 1
          assert tr.frequency("content", u("A")) == 1
          assert tr.doc_frequency("content", u("D")) == 3
          assert tr.frequency("content", u("D")) == 4
          assert tr.doc_frequency("content", u("F")) == 1
          assert tr.frequency("content", u("F")) == 1
          assert tr.doc_frequency("content", u("Z")) == 0
          assert tr.frequency("content", u("Z")) == 0
  
          stats = [
              (fname, text, ti.doc_frequency(), ti.weight())
              for (fname, text), ti in tr
          ]
  
          assert stats == [
              ("content", b("A"), 1, 1),
              ("content", b("B"), 2, 5),
              ("content", b("C"), 2, 2),
              ("content", b("D"), 3, 4),
              ("content", b("E"), 2, 2),
              ("content", b("F"), 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 10 for calling a global function with example usage: test_frequency_keyword() without return types