code: def test_snippets():
      ana = analysis.StemmingAnalyzer()
      schema = fields.Schema(
          text=fields.TEXT(stored=True, analyzer=ana)
      )
      ix = RamStorage().create_index(schema)
      w = ix.writer()
      w.add_document(
          text=u(
              "Lay out the rough animation by creating the important poses where they occur on the timeline."
          )
      )
      w.add_document(
          text=u(
              "Set key frames on everything that's key-able. This is for control and predictability: you don't want to accidentally leave something un-keyed. This is also much faster than selecting the parameters to key."
          )
      )
      w.add_document(
          text=u(
              "Use constant (straight) or sometimes linear transitions between keyframes in the channel editor. This makes the character jump between poses."
          )
      )
      w.add_document(
          text=u(
              "Keying everything gives quick, immediate results. But it can become difficult to tweak the animation later, especially for complex characters."
          )
      )
      w.add_document(
          text=u(
              "Copy the current pose to create the next one: pose the character, key everything, then copy the keyframe in the playbar to another frame, and key everything at that frame."
          )
      )
      w.commit()
  
      target = [
          "Set KEY frames on everything that's KEY-able",
          "Copy the current pose to create the next one: pose the character, KEY everything, then copy the keyframe in the playbar to another frame, and KEY everything at that frame",
          "KEYING everything gives quick, immediate results",
      ]
  
      with ix.searcher() as s:
          qp = qparser.QueryParser("text", ix.schema)
          q = qp.parse(u("key"))
          r = s.search(q, terms=True)
          r.fragmenter = highlight.SentenceFragmenter()
          r.formatter = highlight.UppercaseFormatter()
  
          assert sorted(
              [hit.highlights("text", top=1) for hit in r]
          ) == sorted(target)
  
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 15 for calling a global function with example usage: test_snippets() without return types