code: def test_optional():
      n = fsa.concat_nfa(
          fsa.basic_nfa("a"), fsa.optional_nfa(fsa.basic_nfa("b"))
      )
      assert n.accept("a")
      assert n.accept("ab")
      assert not n.accept("")
      assert not n.accept("b")
      assert not n.accept("ba")
      assert not n.accept("bab")
  
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 15 for calling a global function with example usage: test_optional() without return types