Remove vertex from G

def remove_vertex(self, vertex):
        """
        Remove vertex from G
        """
        try:
            self.vertices.pop(vertex)
            self.succ.pop(vertex)
        except KeyError:
            raise GraphInsertError("Vertex %s doesn't exist." % (vertex,))
        if vertex in self.nodes:
            self.nodes.pop(vertex)
        for element in self.vertices:
            if vertex in self.vertices[element]:
                self.vertices[element].remove(vertex)
        edges = []  # List for edges that include vertex
        for element in self.edges:
            if vertex in element:
                edges.append(element)
        for element in edges:
            del self.edges[element]
        for element in self.pred:
            if vertex in self.pred[element]:
                self.pred[element].remove(vertex)
        for element in self.succ:
            if vertex in self.succ[element]:
                self.succ[element].remove(vertex)