code: def test_page_sorted():
      schema = fields.Schema(key=fields.ID(stored=True))
      with TempIndex(schema, "pagesorted") as ix:
          domain = list(u("abcdefghijklmnopqrstuvwxyz"))
          random.shuffle(domain)
  
          w = ix.writer()
          for char in domain:
              w.add_document(key=char)
          w.commit()
  
          with ix.searcher() as s:
              r = s.search(query.Every(), sortedby="key", limit=5)
              assert r.scored_length() == 5
              assert len(r) == s.doc_count_all()
  
              rp = s.search_page(
                  query.Every(), 1, pagelen=5, sortedby="key"
              )
              assert "".join([h["key"] for h in rp]) == "abcde"
              assert rp[10:] == []
  
              rp = s.search_page(
                  query.Term("key", "glonk"),
                  1,
                  pagelen=5,
                  sortedby="key",
              )
              assert len(rp) == 0
              assert rp.is_last_page()
  
imports: from __future__ import with_statement
  from datetime import datetime, timedelta
  import random
  from whoosh import fields, query, sorting, columns
  from whoosh.compat import u
  from whoosh.compat import permutations, xrange
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 9 for calling a global function with example usage: test_page_sorted() without return types