#NEWLINE# @ fasteners . locked #NEWLINE# @ _pre_check ( check_validated = False ) #NEWLINE# def validate( self ) : #NEWLINE# #INDENT# if LOG . isEnabledFor ( logging . TRACE ) : #NEWLINE# #INDENT# execution_graph = self . _compilation . execution_graph #NEWLINE# LOG . trace ( 'Validating scoping and argument visibility for execution graph with %s nodes and %s edges with density %0.3f' , execution_graph . number_of_nodes ( ) , execution_graph . number_of_edges ( ) , nx . density ( execution_graph ) ) #NEWLINE# #UNINDENT# missing = set ( ) #NEWLINE# last_cause = None #NEWLINE# last_node = None #NEWLINE# missing_nodes = 0 #NEWLINE# for atom in self . _runtime . analyzer . iterate_nodes ( compiler . ATOMS ) : #NEWLINE# #INDENT# exec_missing = self . storage . fetch_unsatisfied_args ( atom . name , atom . rebind , optional_args = atom . optional ) #NEWLINE# revert_missing = self . storage . fetch_unsatisfied_args ( atom . name , atom . revert_rebind , optional_args = atom . revert_optional ) #NEWLINE# atom_missing = exec_missing . union ( revert_missing ) #NEWLINE# if atom_missing : #NEWLINE# #INDENT# cause = exc . MissingDependencies ( atom , sorted ( atom_missing ) , cause = last_cause ) #NEWLINE# last_cause = cause #NEWLINE# last_node = atom #NEWLINE# missing_nodes += 1 #NEWLINE# missing . update ( atom_missing ) #NEWLINE# #UNINDENT# #UNINDENT# if missing : #NEWLINE# #INDENT# if ( ( missing_nodes == 1 ) and ( last_node is self . _flow ) ) : #NEWLINE# #INDENT# raise atom_missing #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise exc . MissingDependencies ( self . _flow , sorted ( missing ) , cause = last_cause ) #NEWLINE# #UNINDENT# #UNINDENT# self . _validated = True