code: def parse_glob(
      pattern,
      _glob_multi="*",
      _glob_single="?",
      _glob_range1="[",
      _glob_range2="]",
  ):
      pos = 0
      last = None
      while pos < len(pattern):
          char = pattern[pos]
          pos += 1
          if char == _glob_multi:  # *
              # (Ignore more than one star in a row)
              if last is not _STAR:
                  yield _STAR, None
                  last = _STAR
          elif char == _glob_single:  # ?
              # (Ignore ? after a star)
              if last is not _STAR:
                  yield _QUEST, None
                  last = _QUEST
          elif char == _glob_range1:  # [
              chars = set()
              negate = False
              # Take the char range specification until the ]
              while pos < len(pattern):
                  char = pattern[pos]
                  pos += 1
                  if char == _glob_range2:
                      break
                  chars.add(char)
              if chars:
                  yield _RANGE, (chars, negate)
                  last = _RANGE
          else:
              yield _LIT, char
              last = _LIT
  
label_desc: Use image node_id 1 for calling a global function with example usage: parse_glob(pattern, _glob_multi, _glob_single, _glob_range1, _glob_range2) without return types