code: def test_replacements():
      sc = scoring.WeightScorer(0.25)
      a = matching.ListMatcher([1, 2, 3], [0.25, 0.25, 0.25], scorer=sc)
      b = matching.ListMatcher([1, 2, 3], [0.25, 0.25, 0.25], scorer=sc)
      um = matching.UnionMatcher(a, b)
  
      a2 = a.replace(0.5)
      assert a2.__class__ == matching.NullMatcherClass
  
      um2 = um.replace(0.5)
      assert um2.__class__ == matching.IntersectionMatcher
      um2 = um.replace(0.6)
      assert um2.__class__ == matching.NullMatcherClass
  
      wm = matching.WrappingMatcher(um, boost=2.0)
      wm = wm.replace(0.5)
      assert wm.__class__ == matching.WrappingMatcher
      assert wm.boost == 2.0
      assert wm.child.__class__ == matching.IntersectionMatcher
  
      ls1 = matching.ListMatcher(
          [1, 2, 3], [0.1, 0.1, 0.1], scorer=scoring.WeightScorer(0.1)
      )
      ls2 = matching.ListMatcher(
          [1, 2, 3], [0.2, 0.2, 0.2], scorer=scoring.WeightScorer(0.2)
      )
      ls3 = matching.ListMatcher(
          [1, 2, 3], [0.3, 0.3, 0.3], scorer=scoring.WeightScorer(0.3)
      )
      mm = matching.MultiMatcher([ls1, ls2, ls3], [0, 4, 8])
      mm = mm.replace(0.25)
      assert mm.current == 2
  
      dm = matching.DisjunctionMaxMatcher(ls1, ls2)
      dm = dm.replace(0.15)
      assert dm is ls2
  
file_path: whoosh/tests/test_quality.py
imports: from __future__ import with_statement
  import random
  from whoosh import fields, matching, scoring
  from whoosh.compat import u, xrange
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.numeric import length_to_byte, byte_to_length
label_desc: Use image node_id 6 for calling a global function with example usage: test_replacements() without return types