code: def test_pages():
      from whoosh.scoring import Frequency
  
      schema = fields.Schema(id=fields.ID(stored=True), c=fields.TEXT)
      ix = RamStorage().create_index(schema)
  
      w = ix.writer()
      w.add_document(id=u("1"), c=u("alfa alfa alfa alfa alfa alfa"))
      w.add_document(id=u("2"), c=u("alfa alfa alfa alfa alfa"))
      w.add_document(id=u("3"), c=u("alfa alfa alfa alfa"))
      w.add_document(id=u("4"), c=u("alfa alfa alfa"))
      w.add_document(id=u("5"), c=u("alfa alfa"))
      w.add_document(id=u("6"), c=u("alfa"))
      w.commit()
  
      with ix.searcher(weighting=Frequency) as s:
          q = query.Term("c", u("alfa"))
          r = s.search(q)
          assert [d["id"] for d in r] == ["1", "2", "3", "4", "5", "6"]
          r = s.search_page(q, 2, pagelen=2)
          assert [d["id"] for d in r] == ["3", "4"]
  
          r = s.search_page(q, 2, pagelen=4)
          assert r.total == 6
          assert r.pagenum == 2
          assert r.pagelen == 2
  
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 9 for calling a global function with example usage: test_pages() without return types