def add(self, graph):
        Parameter.checkClass(graph, PySparseGraph)
        if graph.getNumVertices() != self.getNumVertices():
            raise ValueError("Can only add edges from graph with same number of vertices")
        if self.undirected != graph.undirected:
            raise ValueError("Both graphs must be either undirected or directed")

        newGraph = PySparseGraph(self.vList, self.undirected)
        newGraph.W = self.W.copy()
        newGraph.W.shift(1, graph.W)

        return newGraph
Handles the Apply button being clicked.
dataset/ETHPy150Open charanpald/APGL/apgl/graph/PySparseGraph.py/PySparseGraph.add--crossover with--dataset/ETHPy150Open enthought/envisage/envisage/ui/tasks/preferences_dialog.py/PreferencesDialog.apply