def _add_nodes(self, states, container):
        # to be able to process children recursively as well as the state dict of a machine
        states = states.values() if isinstance(states, dict) else states
        for state in states:
            if state.name in self.seen:
                continue
            elif hasattr(state, 'children') and len(state.children) > 0:
                self.seen.append(state.name)
                sub = container.add_subgraph(name="cluster_" + state._name, label=state.name, rank='same')
                self._add_nodes(state.children, sub)
            else:
                try:
                    shape = self.style_attributes['node']['default']['shape']
                except __HOLE__:
                    shape = 'circle'

                self.seen.append(state.name)
                container.add_node(n=state.name, shape=shape)
dataset/ETHPy150Open tyarkoni/transitions/transitions/extensions/diagrams.py/AGraph._add_nodes