code: def test_cursor():
      schema = fields.Schema(text=fields.TEXT)
      with TempIndex(schema) as ix:
          with ix.writer() as w:
              w.add_document(text="papa quebec romeo sierra tango")
              w.add_document(text="foxtrot golf hotel india juliet")
              w.add_document(text="alfa bravo charlie delta echo")
              w.add_document(text="uniform victor whiskey x-ray")
              w.add_document(text="kilo lima mike november oskar")
              w.add_document(text="charlie alfa alfa bravo bravo bravo")
  
          with ix.reader() as r:
              cur = r.cursor("text")
              assert cur.text() == "alfa"
              assert cur.next() == "bravo"
              assert cur.text() == "bravo"
  
              assert cur.find(b"inc") == "india"
              assert cur.text() == "india"
  
              cur.first() == "alfa"
              assert cur.text() == "alfa"
  
              assert cur.find(b"zulu") is None
              assert cur.text() is None
              assert not cur.is_valid()
  
              assert cur.find(b"a") == "alfa"
              assert cur.term_info().weight() == 3
              assert cur.next() == "bravo"
              assert cur.term_info().weight() == 4
              assert cur.next() == "charlie"
              assert cur.term_info().weight() == 2
  
imports: from __future__ import with_statement
  import random, threading, time
  import pytest
  from whoosh import fields, formats, reading
  from whoosh.compat import b, u, xrange
  from whoosh.reading import SegmentReader
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 17 for calling a global function with example usage: test_cursor() without return types