code: def test_all():
      domain = [
          u("alfa"),
          u("bravo"),
          u("charlie"),
          u("delta"),
          u("echo"),
          u("foxtrot"),
      ]
      schema = fields.Schema(text=fields.TEXT)
      storage = RamStorage()
      ix = storage.create_index(schema)
      w = ix.writer()
      for _ in xrange(100):
          w.add_document(
              text=u(" ").join(
                  choice(domain) for _ in xrange(randint(10, 20))
              )
          )
      w.commit()
  
      # List ABCs that should not be tested
      abcs = ()
      # provide initializer arguments for any weighting classes that require them
      init_args = {
          "MultiWeighting": (
              [scoring.BM25F()],
              {"text": scoring.Frequency()},
          ),
          "ReverseWeighting": ([scoring.BM25F()], {}),
      }
  
      for wclass in _weighting_classes(abcs):
          try:
              if wclass.__name__ in init_args:
                  args, kwargs = init_args[wclass.__name__]
                  weighting = wclass(*args, **kwargs)
              else:
                  weighting = wclass()
          except TypeError:
              e = sys.exc_info()[1]
              raise TypeError(
                  "Error instantiating %r: %s" % (wclass, e)
              )
  
          with ix.searcher(weighting=weighting) as s:
              try:
                  for word in domain:
                      s.search(query.Term("text", word))
              except Exception:
                  e = sys.exc_info()[1]
                  e.msg = "Error searching with %r: %s" % (wclass, e)
                  raise
  
file_path: whoosh/tests/test_weightings.py
imports: from __future__ import with_statement
  import inspect
  from random import choice, randint
  import sys
  from whoosh import fields, query, scoring
  from whoosh.compat import u, xrange, permutations
  from whoosh.filedb.filestore import RamStorage
label_desc: Use image node_id 2 for calling a global function with example usage: test_all() without return types