#NEWLINE# def pathsFromTokens( tokens ) : #NEWLINE# #INDENT# iters = [ ] #NEWLINE# if tokens . expression : #NEWLINE# #INDENT# iters . append ( pathsFromTokens ( tokens . expression ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if tokens . pathExpression : #NEWLINE# #INDENT# iters . append ( [ tokens . pathExpression ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if tokens . call : #NEWLINE# #INDENT# iters . extend ( [ pathsFromTokens ( arg ) for arg in tokens . call . args ] ) #NEWLINE# iters . extend ( [ pathsFromTokens ( kwarg . args [ 0 ] ) for kwarg in tokens . call . kwargs ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for path in itertools . chain ( * iters ) : #NEWLINE# #INDENT# ( yield path )