code: def test_resultspage():
      schema = fields.Schema(
          id=fields.STORED, content=fields.TEXT(stored=True)
      )
      ix = RamStorage().create_index(schema)
  
      domain = ("alfa", "bravo", "bravo", "charlie", "delta")
      w = ix.writer()
      for i, lst in enumerate(permutations(domain, 3)):
          w.add_document(id=text_type(i), content=u(" ").join(lst))
      w.commit()
  
      with ix.searcher() as s:
          q = query.Term("content", u("bravo"))
          r = s.search(q, limit=10)
          tops = list(r)
  
          rp = s.search_page(q, 1, pagelen=5)
          assert rp.scored_length() == 5
          assert list(rp) == tops[0:5]
          assert rp[10:] == []
  
          rp = s.search_page(q, 2, pagelen=5)
          assert list(rp) == tops[5:10]
  
          rp = s.search_page(q, 1, pagelen=10)
          assert len(rp) == 54
          assert rp.pagecount == 6
          rp = s.search_page(q, 6, pagelen=10)
          assert len(list(rp)) == 4
          assert rp.is_last_page()
  
          with pytest.raises(ValueError):
              s.search_page(q, 0)
          assert s.search_page(q, 10).pagenum == 6
  
          rp = s.search_page(query.Term("content", "glonk"), 1)
          assert len(rp) == 0
          assert rp.is_last_page()
  
imports: from __future__ import with_statement
  import pytest
  from whoosh import analysis, fields, formats, highlight, qparser, query
  from whoosh.codec.whoosh3 import W3Codec
  from whoosh.compat import u, xrange, text_type, permutations
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempStorage, TempIndex
label_desc: Use image node_id 13 for calling a global function with example usage: test_resultspage() without return types