code: def test_regular():
      ex = fsa.star_nfa(
          fsa.choice_nfa(fsa.basic_nfa("a"), fsa.basic_nfa("b"))
      )
  
      assert ex.accept("")
      assert ex.accept("a")
      assert ex.accept("aaaa")
      assert ex.accept("b")
      assert ex.accept("bbbb")
      assert ex.accept("abab")
      assert ex.accept("babb")
  
      ex = fsa.concat_nfa(
          fsa.basic_nfa("a"),
          fsa.concat_nfa(
              fsa.optional_nfa(fsa.basic_nfa("b")), fsa.basic_nfa("c")
          ),
      )
  
      assert ex.accept("ac")
      assert ex.accept("abc")
      assert not ex.accept("ab")
      assert not ex.accept("bc")
  
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 17 for calling a global function with example usage: test_regular() without return types