code: def test_insert():
      nfa1 = fsa.NFA(1)
      nfa1.add_transition(1, "a", 2)
      nfa1.add_transition(2, "b", 3)
      nfa1.add_final_state(3)
  
      nfa2 = fsa.NFA(4)
      nfa2.add_transition(4, "x", 5)
      nfa2.add_transition(4, "y", 5)
      nfa2.insert(4, nfa1, 5)
      nfa2.add_final_state(5)
  
      assert nfa2.accept("x")
      assert nfa2.accept("y")
      assert nfa2.accept("ab")
      assert not nfa2.accept("a")
  
imports: import gzip
  import os.path
  from bisect import bisect_left
  from whoosh.compat import permutations
  from whoosh.compat import xrange
  from whoosh.automata import fsa, glob, lev
  from whoosh.support.levenshtein import levenshtein
label_desc: Use image node_id 4 for calling a global function with example usage: test_insert() without return types