code: def test_maxclasses():
      terms = frozenset(("alfa", "bravo", "charlie", "delta", "echo"))
      sa = analysis.StandardAnalyzer()
      cf = highlight.ContextFragmenter(surround=6)
      hf = highlight.HtmlFormatter(
          tagname="b", termclass="t", maxclasses=2
      )
      htext = highlight.highlight(_doc, terms, sa, cf, hf)
      assert (
          htext
          == '<b class="match t0">alfa</b> <b class="match t1">bravo</b> <b class="match t0">charlie</b>...<b class="match t1">delta</b> <b class="match t0">echo</b> foxtrot'
      )
  
imports: from __future__ import with_statement
  import pytest
  from whoosh import analysis, highlight, fields, qparser, query
  from whoosh.compat import u
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 8 for calling a global function with example usage: test_maxclasses() without return types