code: def test_span_first():
      ix = get_index()
      with ix.searcher() as s:
          for word in domain:
              q = spans.SpanFirst(Term("text", word))
              m = q.matcher(s)
              while m.is_active():
                  sps = m.spans()
                  original = s.stored_fields(m.id())["text"]
                  assert original[0] == word
                  assert len(sps) == 1
                  assert sps[0].start == 0
                  assert sps[0].end == 0
                  m.next()
  
          q = spans.SpanFirst(Term("text", "bravo"), limit=1)
          m = q.matcher(s)
          while m.is_active():
              orig = s.stored_fields(m.id())["text"]
              for sp in m.spans():
                  assert orig[sp.start] == "bravo"
              m.next()
  
imports: from __future__ import with_statement
  from whoosh import analysis, fields, formats
  from whoosh.compat import u, xrange, permutations
  from whoosh.filedb.filestore import RamStorage
  from whoosh.query import spans
  from whoosh.query import And, Or, Term, Phrase
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 5 for calling a global function with example usage: test_span_first() without return types