code: def glob_automaton(pattern):
      nfa = NFA(0)
      i = -1
      for i, (op, arg) in enumerate(parse_glob(pattern)):
          if op is _LIT:
              nfa.add_transition(i, arg, i + 1)
          elif op is _STAR:
              nfa.add_transition(i, ANY, i + 1)
              nfa.add_transition(i, EPSILON, i + 1)
              nfa.add_transition(i + 1, EPSILON, i)
          elif op is _QUEST:
              nfa.add_transition(i, ANY, i + 1)
          elif op is _RANGE:
              for char in arg[0]:
                  nfa.add_transition(i, char, i + 1)
      nfa.add_final_state(i + 1)
      return nfa
  
label_desc: Use image node_id 2 for calling a global function with example usage: glob_automaton(pattern) and returns: nfa