(self, graph)
return nodes_map
Builds a mapping of node names to their defs from the graph.
Builds a mapping of node names to their defs from the graph.
Builds a mapping of node names to their defs from the graph .
def create_nodes_map(self, graph):
    """Builds a mapping of node names to their defs from the graph."""
    nodes_map = {}
    for node in graph.node:
      if node.name not in nodes_map.keys():
        nodes_map[node.name] = node
      else:
        raise ValueError("Duplicate node names detected.")
    return nodes_map
def create_nodes_map ( self , graph ) : nodes_map = { } for node in graph . node : if node . name not in nodes_map . keys ( ) : nodes_map [ node . name ] = node else : raise ValueError ( "Duplicate node names detected." ) return nodes_map