code: def test_sorted_groups():
      schema = fields.Schema(
          a=fields.STORED, b=fields.TEXT, c=fields.ID
      )
      ix = RamStorage().create_index(schema)
      with ix.writer() as w:
          w.add_document(a=0, b=u("blah"), c=u("apple"))
          w.add_document(a=1, b=u("blah blah"), c=u("bear"))
          w.add_document(a=2, b=u("blah blah blah"), c=u("apple"))
          w.add_document(a=3, b=u("blah blah blah blah"), c=u("bear"))
          w.add_document(
              a=4, b=u("blah blah blah blah blah"), c=u("apple")
          )
          w.add_document(
              a=5, b=u("blah blah blah blah blah blah"), c=u("bear")
          )
  
      with ix.searcher() as s:
          q = query.Term("b", "blah")
          r = s.search(q, groupedby="c")
          gs = r.groups("c")
          assert gs["apple"] == [4, 2, 0]
          assert gs["bear"] == [5, 3, 1]
  
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 29 for calling a global function with example usage: test_sorted_groups() without return types