def _break_cycles(self, order, graph):
        broken_edges = []

        strong = [s for s in nx.strongly_connected_components(graph)
                  if len(s) > 1]

        if strong:
            # copy the graph, because we don't want to modify the starting graph
            graph = graph.subgraph(graph.nodes_iter())

        while strong:
            # First of all, see if the cycle has in edges
            in_edges = []
            start = None
            if len(strong[0]) < len(graph):
                for s in strong[0]:
                    count = len([u for u, v in graph.in_edges(s)
                                if u not in strong[0]])
                    in_edges.append((count, s))
                in_edges = sorted(in_edges)
                if in_edges[-1][0] > 0:
                    start = in_edges[-1][1]  # take the node with the most in edges

            if start is None:
                # take the first system in the existing order that is found
                # in the SCC and disconnect it from its predecessors that are
                # also found in the SCC
                for node in order:
                    if self.pathname:
                        node = '.'.join((self.pathname, node))
                    if node in strong[0]:
                        start = node
                        break

            # break cycles
            for p in graph.predecessors(start):
                if p in strong[0]:
                    graph.remove_edge(p, start)
                    broken_edges.append((p, start))

            strong = [s for s in nx.strongly_connected_components(graph)
                      if len(s) > 1]

        return graph, broken_edges
Set the enabled state of the page.
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/core/group.py/Group._break_cycles--crossover with--dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/wx/wx_page.py/wxPage.SetEnabled