code: def _build_path_iterator(path):
      # parse pattern
      stream = iter(
          [
              (special, text)
              for (special, text) in path_tokenizer(path)
              if special or text
          ]
      )
      try:
          _next = stream.next
      except AttributeError:
          # Python 3
          def _next():
              return next(stream)
  
      token = _next()
      selector = []
      while 1:
          try:
              selector.append(operations[token[0]](_next, token))
          except StopIteration:
              raise ValueError("invalid path")
          try:
              token = _next()
              if token[0] == "/":
                  token = _next()
          except StopIteration:
              break
      return selector
  
imports: from __future__ import absolute_import
  import re
  import operator
  import sys
label_desc: Use image node_id 14 for calling a global function with example usage: _build_path_iterator(path) and returns: selector, next