#NEWLINE# def _resolve_dependencies( G ) : #NEWLINE# #INDENT# '\n    Traverse the dependency graph starting from resolved nodes\n    ' #NEWLINE# context = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for name in nx . topological_sort ( G ) : #NEWLINE# #INDENT# node = G . node [ name ] #NEWLINE# try : #NEWLINE# #INDENT# context [ name ] = _render ( node , context ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# LOG . debug ( 'Failed to render %s: %s' , name , e , exc_info = True ) #NEWLINE# msg = ( 'Failed to render parameter "%s": %s' % ( name , str ( e ) ) ) #NEWLINE# raise ParamException ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# return context