code: def test_nfa2():
      nfa = fsa.NFA(1)
      nfa.add_transition(1, "a", 2)
      nfa.add_transition(1, "c", 4)
      nfa.add_transition(2, "b", 3)
      nfa.add_transition(2, fsa.EPSILON, 1)
      nfa.add_transition(3, "a", 2)
      nfa.add_transition(4, "c", 3)
      nfa.add_transition(4, fsa.EPSILON, 3)
      nfa.add_final_state(3)
  
      assert nfa.accept("ab")
      assert nfa.accept("abab")
      assert nfa.accept("cc")
      assert nfa.accept("c")
      assert nfa.accept("ccab")
      assert nfa.accept("ccacc")
      assert nfa.accept("ccac")
      assert nfa.accept("abacab")
  
      assert not nfa.accept("b")
      assert not nfa.accept("a")
      assert not nfa.accept("cb")
      assert not nfa.accept("caa")
  
      dfa = nfa.to_dfa()
      assert dfa.accept("ab")
      assert dfa.accept("abab")
      assert dfa.accept("cc")
      assert dfa.accept("c")
      assert dfa.accept("ccab")
      assert dfa.accept("ccacc")
      assert dfa.accept("ccac")
      assert dfa.accept("abacab")
  
      assert not dfa.accept("b")
      assert not dfa.accept("a")
      assert not dfa.accept("cb")
      assert not dfa.accept("caa")
  
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 3 for calling a global function with example usage: test_nfa2() without return types